4 Replies - 243 Views - Last Post: 05 August 2012 - 03:09 AM Rate Topic: -----

#1 chenaz  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 82
  • Joined: 24-November 11

textboxs and buttons

Posted 05 August 2012 - 12:52 AM

hi
assume that i had 2 textbox textbox1 and textbox2.
and i had 3 buttons. button1,button2,button3.

i want selected textbox to get text from the buttons when use click on selected textbox.
i know it is something like mouse down or mouse leave event. but i donno how to do it.
anyone can give hints?
    Private Sub Button10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button10.Click
        TextBox2.SelectedText = 8
    End Sub

this will only let me fillup 1 textbox. i cant fill up textbox1 if i wwant to.
how do i make it fill up textbox1 when user click on it?

Is This A Good Question/Topic? 0
  • +

Replies To: textboxs and buttons

#2 smohd  Icon User is offline

  • Critical Section
  • member icon



Reputation: 1746
  • View blog
  • Posts: 4,409
  • Joined: 14-March 10

Re: textboxs and buttons

Posted 05 August 2012 - 01:15 AM

Quote

i want selected textbox to get text from the buttons when use click on selected textbox.
I didnt get what you want to do here, when user click on a text box, what text do you want to get? Text box has mouse click and getFocus events, so may be those will help you to do your work.
Was This Post Helpful? 0
  • +
  • -

#3 chenaz  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 82
  • Joined: 24-November 11

Re: textboxs and buttons

Posted 05 August 2012 - 01:23 AM

View Postsmohd, on 05 August 2012 - 01:15 AM, said:

Quote

i want selected textbox to get text from the buttons when use click on selected textbox.
I didnt get what you want to do here, when user click on a text box, what text do you want to get? Text box has mouse click and getFocus events, so may be those will help you to do your work.

i wan selected textbox to get text from selected buttons.
.
in a windowform, i had a numberpad and 2 textbox.
i wan selected textbox to get text from selected buttons
Was This Post Helpful? 0
  • +
  • -

#4 smohd  Icon User is offline

  • Critical Section
  • member icon



Reputation: 1746
  • View blog
  • Posts: 4,409
  • Joined: 14-March 10

Re: textboxs and buttons

Posted 05 August 2012 - 01:44 AM

Quote

i wan selected textbox to get text from selected buttons.

You cant have two controls selected at a time in a for, or have focus. What you can do is creating a class variable that holds which textbox got focus last, which means if a textbox get focus, it sets itself to that variable, and then buttons will have to send text to the one set by that class variable.
Was This Post Helpful? 0
  • +
  • -

#5 chenaz  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 82
  • Joined: 24-November 11

Re: textboxs and buttons

Posted 05 August 2012 - 03:09 AM

View Postsmohd, on 05 August 2012 - 01:44 AM, said:

Quote

i wan selected textbox to get text from selected buttons.

You cant have two controls selected at a time in a for, or have focus. What you can do is creating a class variable that holds which textbox got focus last, which means if a textbox get focus, it sets itself to that variable, and then buttons will have to send text to the one set by that class variable.

i remember that textbox can capture where mouse pointer was and then the buttons will send the text to where pointer was?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1