473,385 Members | 1,908 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

how to disable textbox when click on radiobutton using VB script on Visual Studio.Net

how to disable textbox when click on radiobutton using VB script on Visual Studio.Net 2005.

currently i used this coding but it is not functioning.


Expand|Select|Wrap|Line Numbers
  1. Private sub RadioButton1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton1.CheckedChanged
  2.  
  3.         If RadioButton1.Checked Then
  4.             Me.textBox1.Visible = True
  5.         Else
  6.             Me.textBox1.Visible = False
  7.         End If
  8.     End Sub
Mar 11 '10 #1

✓ answered by hidayu1986

i already try this code. is it that you mean?


Private Sub RadioButton1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton1.CheckedChanged
Me.TextBox3.Visible = RadioButton1.Checked
End Sub
End Class

5 9046
tlhintoq
3,525 Expert 2GB
TIP: When you are writing your question, there is a button on the tool bar that wraps the [code] tags around your copy/pasted code. It helps a bunch. Its the button with a '#' on it. More on tags. They're cool. Check'em out.
Mar 11 '10 #2
tlhintoq
3,525 Expert 2GB
I might suggest something a bit more... smooth.

Expand|Select|Wrap|Line Numbers
  1. Private sub RadioButton1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton1.CheckedChanged
  2.  
  3. Me.textBox1.Visible = RadioButton1.Checked
  4.  
  5.     End Sub
The right side of an equasion is evaluated before the left.
Thus if RadioButton1.Checked evaluates to true, then me.textBox1.Visible is set to true.
Mar 11 '10 #3
thank u very much for your tips and your code suggestion. i already try it but it still the same not functioning when i click on radiobutton, the text box still not visible
Mar 11 '10 #4
tlhintoq
3,525 Expert 2GB
Then you aren't running the code. It's that simple.

Are you sure you have assigned this method as the event handler to the control?

Have you put a breakpoint in (at line 3) to watch the code break on this line, to ensure it is being executed?
Mar 11 '10 #5
i already try this code. is it that you mean?


Private Sub RadioButton1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton1.CheckedChanged
Me.TextBox3.Visible = RadioButton1.Checked
End Sub
End Class
Mar 11 '10 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: msnews.microsoft.com | last post by:
Hello! I'm Jim by asp How can show "abc" in textbox when click one botton?
0
by: James Smith | last post by:
When I am trying to compile c# code with visual studio 2003 it takes about ten times longer than it should. It appears t be trying to connect to various servers and times out on three of them which...
6
by: Reinhard Lehner | last post by:
Hi there! I spent the last week trying to fix this problem - I am always getting an error when trying to run an application (WinForms or PPC) out of Visual Studio IDE: 'Error while trying to...
0
by: Wendy Elizabeth | last post by:
When I am using Visual Studio.net in the debug mode, I want to be able to increase the size of values that can be displayed. For example when using the "watch" or other debug windows, I know I want...
5
by: Charlie | last post by:
I am a student taking a computer class programmning with ms visual C++. The college is using ms visual C++ 6.0 on it's computers. I purchased ms visual studio.net (Academic) (ver 2003) which is...
3
by: Charlie1 | last post by:
I am a student taking c++ programming I purchased a program Visual Studio.net (2003 ver), The college is using visual C++ 6.0. How can I use my porgram to write programs in Ms 6.0. Do I have to...
2
by: patrick lynch | last post by:
Good morning, I'm reading "Programming Microsoft Windows with Microsoft Visual Basic .NET" by Charles Petzold. I have Visual Studio installed but it is now expired (as an aside, I can not...
0
by: DR | last post by:
How to make CLR stored procedure generate comments in TSQL when it is deployed via visual studio? e.g. when i right click the project and hit deploy, i want some comments to appear in or around...
0
Maidenz08
by: Maidenz08 | last post by:
Hi, I need to add a textbox in a form in setup and deployment project in visual studio 2005. I also need to read the value of the textbox and write it into a text file in the installed location...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.