Hi all..
Let me start out by saying my skill with vb .net is somewhere between unexperienced and slightly experienced, so don't go to hard on me
I have around 100 checkboxes on my form and when checked or unchecked they need do something depending on the state of the checkbox.
Looking at my code below you can see after the else statement that if the condition isn't true, I want the checkbox to remain unchecked.
Help me out here guys..I think I need to do something with an event handler?![]()
Code:Private Sub chkAir_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles chkDustDevil.CheckedChanged, chkLightningBolt.CheckedChanged, 'etc etc chkboxstatus() End Sub Private Sub chkboxstatus() If ActiveControl.Tag = "c" Then txtCharSkillPts.Text = txtCharSkillPts.Text + txtSpellSkillPts.Text ActiveControl.Tag = "u" Else If txtCharSkillPts.Text >= txtSpellSkillPts.Text Then txtCharSkillPts.Text = txtCharSkillPts.Text - txtSpellSkillPts.Text ActiveControl.Tag = "c" Else 'don't allow checkbox to be checked End If End If End Sub





Reply With Quote