473,513 Members | 3,076 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Assign a value to groupbox from a radiobutton contained in groupbo

Hello,

Is it possible to assign a value to a groupbox by selecting a radiobutton
contained in the groupbox?

Say you assign a value of 1 to radbtn1, 2 for radbtn2, 3 for radbtn3 all
contained in grpBox. You click radbtn1.

Console.writeline(grpBox.Value.ToString)

Is there a way to do something like this? (VB2005)

Thanks,
Rich
Aug 4 '06 #1
2 6595
"Rich" <Ri**@discussions.microsoft.comschrieb:
Is it possible to assign a value to a groupbox by selecting a radiobutton
contained in the groupbox?

Say you assign a value of 1 to radbtn1, 2 for radbtn2, 3 for radbtn3 all
contained in grpBox. You click radbtn1.

Console.writeline(grpBox.Value.ToString)

Is there a way to do something like this? (VB2005)
Add a common event handler to all the radio buttons which belong to a group:

\\\
Private m_Group1SelectedRadioButton As RadioButton

Private Sub RadioButtonGroup1_CheckedChanged( _
ByVal sender As Object, _
ByVal e As EventArgs _
) Handles _
RadioButton1.CheckedChanged, _
RadioButton2.CheckedChanged, _
RadioButton3.CheckedChanged

Dim SourceControl As RadioButton = DirectCast(sender, RadioButton)
If SourceControl.Checked Then
m_Group1SelectedRadioButton = SourceControl
End If
End Sub
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Aug 4 '06 #2
Thank you very much. That was just what I was looking for.

Rich

"Herfried K. Wagner [MVP]" wrote:
"Rich" <Ri**@discussions.microsoft.comschrieb:
Is it possible to assign a value to a groupbox by selecting a radiobutton
contained in the groupbox?

Say you assign a value of 1 to radbtn1, 2 for radbtn2, 3 for radbtn3 all
contained in grpBox. You click radbtn1.

Console.writeline(grpBox.Value.ToString)

Is there a way to do something like this? (VB2005)

Add a common event handler to all the radio buttons which belong to a group:

\\\
Private m_Group1SelectedRadioButton As RadioButton

Private Sub RadioButtonGroup1_CheckedChanged( _
ByVal sender As Object, _
ByVal e As EventArgs _
) Handles _
RadioButton1.CheckedChanged, _
RadioButton2.CheckedChanged, _
RadioButton3.CheckedChanged

Dim SourceControl As RadioButton = DirectCast(sender, RadioButton)
If SourceControl.Checked Then
m_Group1SelectedRadioButton = SourceControl
End If
End Sub
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Aug 4 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
7384
by: Sergei | last post by:
Hi, I am displaying modal dialog and passing values from the main form to the modal dialog and back. It works fine but if I used the following syntax on Page_Load(just for testing) in VB to assign value form the object to text Box it gives error 'Object required' Dim strResponse As String strResponse = strResponse & "<script...
0
1773
by: JJ_377 | last post by:
The following doesn't assign value to the dropdownlist - WHY? ___________________________________________________________________ In a user control (ascx named USACustomer) : Public Property State() As String Get Return Me.ddlState.SelectedValue End Get Set(ByVal Value As String)
0
2790
by: gladiator | last post by:
Hello Here I wrote an example by which an const variable can be assigned witha value but I can not understand how can it assign value. #include<stdio.h> int main(void) { const int i=10; *(int *)&i=20;
4
3328
by: harpreet1433 | last post by:
i have a arraylist what i want to do is assign value of textarea to arraylist ie arr(0)=value of textarea(in javascript) is it possible thanks
1
2442
by: harpreet1433 | last post by:
how to assign value to a hidden field of stuts form what i actually want to do that assign it through javascript document.all.fieldname=value works well under IE and Netscape but in mozilla it is not able to assign value. is there any other way to assign value
1
8682
by: No_Spam | last post by:
I have an MS Access form attached to a table. I have a text box which has its control source set to a field in the table... However, at run time if certain things change, I want to the change the text box value to the new number, but I'm unable to do so. I get run time error 2448, you cannot assign value to this object.. The text box is...
7
2029
vikas251074
by: vikas251074 | last post by:
Can I assign value to cookies immediately after selecting a value from list? <select name="vlan_name" style="width:150px "> <%set rs = conn.execute("select vlan_name from vlan_master order by vlan_name") dim v_lan do while not rs.eof%> <option value="<%=rs("vlan_name")%>"><%=rs("vlan_name")%></option> <% rs.movenext loop%>...
3
10392
by: sql2020 | last post by:
Hi, i am new to windows application. I have successfully list DataGridView with contain in a table. SqlConnection conn = new SqlConnection(map); string sql = "Select * from Table_Name"; SqlDataAdapter adap = new SqlDataAdapter(sql, conn); SqlCommandBuilder build = new SqlCommandBuilder(adap); DataTable dt = new DataTable("Table_Name");...
17
9551
by: zombiezoom | last post by:
I need help with error 2448: You can't assign value to this object. What I am trying to do is allow user to select event id and race id from combo option. Once the user selects those, then the id associated with those is suppose to be carried over to a new form which should associated those two ids with runner id from runner table. Thus, I will...
0
7269
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7177
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7559
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
4756
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3248
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3237
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1611
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
811
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
470
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.