I have 2 buttons in my form. So when i press on Button1 , value "A" will come in textbox2 & textbox3 and when i press Button2 "B" will come in textbox2 & textbox3.
User can enter how much ever values to the textbox2 & textbox3 which will append to the last.
And also user can click on the textbox2 anywhere user wants , and can enter the values using button click event . ( I am using textbox2.Seltext instead of textbox2.text) .
Issue i am facing :
User pressed button1 2 times : Values in textbox2 and textbox3 will be " A A ".
Now the User pressed in between "A A" in the textbox. and then pressed button 2.
Values in textbox1 will be "A B A" while in textbox3 will be " A A B" . But i want the values in textbox3 same as textbox2 "A B A" .
Code:
Private Sub Button1_Click()
If TextBox2.SelText = "" Then
TextBox2.SelText = " A "
TextBox3.SelText = " A "
Else
TextBox2.SelText = TextBox2.SelText + " A "
TextBox3.SelText = TextBox3.SelText + " A "
End If
End Sub
Code:
Private Sub Button2_Click()
If TextBox2.SelText = "" Then
TextBox2.SelText = " B "
TextBox3.SelText = " B "
Else
TextBox2.SelText = TextBox2.SelText + " B "
TextBox3.SelText = TextBox3.SelText + " B "
End If
End Sub