Home  |  About  | Last |  Submit  |  Contact
AllQuests.com



Previous Question:  [RESOLVED] Data Types Float Decimal  Visual Basic .NETNext Question:  VS 2010 Click Once  Visual Basic .NET
Question VS 2010 Radiobutton and textbox ( VBForums Visual Basic .NET )
Updated: 2010-08-17 16:20:09 (8)
VS 2010 Radiobutton and textbox

How can I do once I click on "textbox.text" This will select on RadioButton?

Answers: VS 2010 Radiobutton and textbox ( VBForums Visual Basic .NET )
VS 2010 Radiobutton and textbox

What?

Are you asking if the user click on a specific TextBox, then the corresponding RadioButton will be checked?

If so, handle the TextBox's Clicked event and call .Checked = True on the appropriate RadioButton.

If not, you'll need to be more clear.

weirddemon

VS 2010 Radiobutton and textbox

i try this:
vb Code:
  1. If TextBox1.SelectedText = True Then
  2.             RadioButton2.Checked = True

What is missing? (It does not display me an error but it does not work)

OR444

VS 2010 Radiobutton and textbox

For us to know why your code isn't doing what you intended, we'd have to know what you intended. That's far from obvious from your code, which doesn't really make sense. In future, please take the time to post a FULL and CLEAR description of the problem. Posting a code snippet and saying it doesn't work doesn't qualify.

As for the problem, I suggest that you start by reading the documentation for the TextBox.SelectedText property. The fact that you're comparing it to a Boolean value shows that what you think it does is not what it actually does. The SelectedText property returns the part of the Text that is selected. For instance, if you type "Hello" into a TextBox and then use the mouse to highlight just the two Ls, SelectedText will return the part of the Text that is selected, i.e. "ll". If no text is highlighted then SelectedText will be an empty string. Regardless, it's a String, not a Boolean.

jmcilhinney

VS 2010 Radiobutton and textbox

Your question isn't clear. But as far as I can understand you want to check the radiobutton when you click the textbox.

Add this to your code:

Code:
Private Sub TextBox1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox1.Click
RadioButton1.Checked=True
End Sub
If this isn't what you want then, then please explain your problem correctly.

Xscapism

VS 2010 Radiobutton and textbox

sory my english is bad
just want to do I click on my textbox1.text and This will select a radio button


OR444

VS 2010 Radiobutton and textbox

Quote:
Originally Posted by OR444
sory my english is bad
just want to do I click on my textbox1.text and This will select a radio button

I already posted the solution in my previous post. Anyways here's it again. Add this to your code.

Code:
Private Sub TextBox1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox1.Click
RadioButton1.Checked=True
End Sub

Xscapism

VS 2010 Radiobutton and textbox

Quote:
Originally Posted by Xscapism
I already posted the solution in my previous post. Anyways here's it again. Add this to your code.

Code:
Private Sub TextBox1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox1.Click
RadioButton1.Checked=True
End Sub
Sorry
thanks a lot .. Works great!

OR444

VS 2010 Radiobutton and textbox

u can help me hare too?
http://www.vbforums.com/showthread.php?t=623876
http://www.vbforums.com/showthread.php?t=623977

OR444

Previous Question:  [RESOLVED] Data Types Float Decimal  VBForums  Visual Basic .NETNext Question:  VS 2010 Click Once  VBForums  Visual Basic .NET

- Source: VS 2010 Radiobutton and textbox VBForums Visual Basic .NET
- Previous Question: [RESOLVED] Data Types Float Decimal VBForums Visual Basic .NET
- Next Question: VS 2010 Click Once VBForums Visual Basic .NET