I have two radio btuttons which link me to another form but they have failed to likk me to the forms i directhem to link me to.
i dont know if ther is any problem with my code this is the code. some one to help me
Dim one As boolean Dim two As boolean If one = True Then frmone.Show Else If two = True Then frmsec.Show Else me.hide End if
But how you set the value of the boolean variables ?
See if this helps.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If RadioButton1.Checked Then MsgBox("RadioButton1 is Checked.") If RadioButton2.Checked Then MsgBox("RadioButton2 is Checked.") End Sub
First declare your forms in your main form public class.
Dim showForm2 As New Form2 Dim showForm3 As New Form3
Then in your button click event set your if statements to show which form you need.
If RadioButton1.Checked = True Then showForm2.Show() End If If RadioButton2.Checked = True Then showForm3.Show() End If
Declaring a boolean for this project is redundant because the radio button in itself
is a boolean.
Hope this Helps
P.S If you want people to be able to help you to the best of their abilities please
be sure to post as much of your own source Code as possible otherwise it's pretty difficult to understand what you really want.
Private Sub RadioButton1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton1.CheckedChanged Form2.Show() End Sub Private Sub RadioButton2_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton2.CheckedChanged Form3.Show() End Sub
This would be the simplest one. Just Try this one.
thank you then let me try it out
Am sorry am new to the language so i keep testing my self
thank you the code worked am looking forward to produce the best
This is the first in (hopefully) a series of posts about vbScript. Please see my post vbScript - The Basics for more details on vbScript.
My wife and I take ...
Hi, I've written this code which i send below. now i have a listview, and when i click each item in my listview, i want it's related word to be ...
My plan is to post a series of hopefully useful and informative vbScript Functions and Subs. I started writing up my first code snippet and found ...