2 Replies - 2380 Views - Last Post: 03 May 2007 - 12:18 PM Rate Topic: -----

#1 unlimited  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 27
  • Joined: 16-April 07

Displaying text from a button to a text box

Posted 03 May 2007 - 11:37 AM

well I'm trying to create a calculator (as a first VB project :P) but I can't manage to figure the code out :(

Dim button1 As Double = 1
Dim textbox1 As Double = 0
button1 = textbox1 = 1


the code UP is just one of my many attempts to make a button(when pressed) to display s number in the textbox so can someone please help :D


Thanks in advance

Is This A Good Question/Topic? 0
  • +

Replies To: Displaying text from a button to a text box

#2 tody4me  Icon User is offline

  • Banned
  • member icon

Reputation: 12
  • View blog
  • Posts: 1,398
  • Joined: 12-April 06

Re: Displaying text from a button to a text box

Posted 03 May 2007 - 12:13 PM

when button 1 is pressed you want to display the .text property of the button in the .text property of the text box. so something like this, not 100% on syntax because i don't code a lot in vb anymore, since .net.

public sub ButonHandler(object sender, eventargs e) handles button1.click
textbox1.text = sender.text
end sub


Was This Post Helpful? 0
  • +
  • -

#3 unlimited  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 27
  • Joined: 16-April 07

Re: Displaying text from a button to a text box

Posted 03 May 2007 - 12:18 PM

thanks for the code :) ill try this now but one question is .NET better then VB?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1