angerist Grandmaster Cheater Supreme
Reputation: 0
Joined: 18 Jun 2007 Posts: 1011 Location: Australia.
|
Posted: Wed Sep 30, 2009 2:43 am Post subject: [VB.NET] CheckBox Verifaction |
|
|
Hey guys,
Got a small problem, I need to run a check to see if any of the checkbox's inside a groubox are checked. And if not Textbox = "Select Something".
The sample bellow does what I want for just 1 check box. What I need is for it to check if any of the check boxes that are within a group box are checked.
If CheckBox1.Checked = False Then
TextBox1.Text = "Select Something"
Else If CheckBox1.Checked = True Then
TextBox1.Text = "Done!"
End If
Discuss...
Temp Fix
| Code: |
If Attach.Checked = False Then
Waiting.Text = "Select Something"
End If
If GunSound.Checked = False Then
Waiting.Text = "Select Something"
End If
If Chara.Checked = False Then
Waiting.Text = "Select Something"
End If
If Guns.Checked = False Then
Waiting.Text = "Select Something"
End If
If Map.Checked = False Then
Waiting.Text = "Select Something"
End If
If Attach.Checked = True Then
Waiting.Text = "Done!"
End If
If GunSound.Checked = True Then
Waiting.Text = "Done!"
End If
If Chara.Checked = True Then
Waiting.Text = "Done!"
End If
If Guns.Checked = True Then
Waiting.Text = "Done!"
End If
If Map.Checked = True Then
Waiting.Text = "Done!"
End If |
Some other annoyances aha, This one's going to be difficult to explain.
Well I want to check if a group of files is found at the directory that the user selects. In this case I'm Using FolderBrowserDialog this is the psuedocode that I came up with in notepad to better explain.
| Code: | If System.IO.File.Exists.FolderDialog.SelectedPath ("ATTACH_T.rez") False Then
Textbox1.Text = "No Files Found" |
This is a working method of how to check if only 1 file is at a certain directory. But the thing is that you have to know what directory to put in the code, on my app the user selects there own directory.
| Code: | If File.Exists("C:\MyDocs\MyFile.txt") = False Then
MsgBox("Field does not exist!", MsgBoxStyle.Critical, "File Not Found")
Application.Exit()
End If |
_________________
|
|