Results 1 to 25 of 25

Thread: Checkboxes behave as radio buttons

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jul 2012
    Location
    Denmark
    Posts
    216

    Checkboxes behave as radio buttons

    Hi,

    I am facing a problem which it seems I can’t find a solution to.

    I have 4 checkboxes in a panel. One of the checkboxes is checked at load.
    Now I would like the checkboxes to behave like radio buttons. Only one can be checked at a time.

    I can’t use radio buttons because, my checkboxes are user controls with some extra features.

    Thank you in advance.

  2. #2
    PowerPoster kaliman79912's Avatar
    Join Date
    Jan 2009
    Location
    Ciudad Juarez, Chihuahua. Mexico
    Posts
    2,593

    Re: Checkboxes behave as radio buttons

    Loop through all the controls inside the panel, uncheck them all, and then check the current one.

    To create the loop you do something like:

    Code:
    For Each myControl in myPanel.Controls
    It would be a good idea to cast myControl to a checkBox so you have intellisense and all the early binding.

    to uncheck all checkBoxes, put this inside the loop:

    Code:
    myControl.Checked = False
    to check the current control:

    Code:
    sender.Checked = True
    Also, good idea to cast the sender.

    Remember to have that Sub as a handler for all checkBoxes CheckedChanged event. One important thing here is that you are changing the checked property of the boxes, so if you are not careful, this will be a recursive event that could overflow easily. Either do it with a control boolean variable, or disable and enable the event handlers.
    Last edited by kaliman79912; Aug 27th, 2015 at 01:47 PM.
    More important than the will to succeed, is the will to prepare for success.

    Please rate the posts, your comments are the fuel to keep helping people

  3. #3
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: Checkboxes behave as radio buttons

    Quote Originally Posted by kaliman79912 View Post
    Loop through all the controls inside the panel, uncheck them all, and then check the current one.

    To create the loop you do something like:

    Code:
    For Each myControl in myPanel.Controls
    It would be a good idea to cast myControl to a checkBox so you have intellisense and all the early binding.

    to uncheck all checkBoxes, put this inside the loop:

    Code:
    myControl.Checked = False
    to check the current control:

    Code:
    sender.Checked = True
    Also, good idea to cast the sender.

    Remember to have that Sub as a handler for all checkBoxes CheckedChanged event.
    To add to this, you can filter the controls to just the type you care about in the loop like this:
    Code:
            For Each C As CheckBox In myPanel.Controls.OfType(Of CheckBox)()
    
            Next

  4. #4
    PowerPoster kaliman79912's Avatar
    Join Date
    Jan 2009
    Location
    Ciudad Juarez, Chihuahua. Mexico
    Posts
    2,593

    Re: Checkboxes behave as radio buttons

    Here's the solution manipulating the eventHandlers

    Code:
        Private Sub CheckBox1_CheckedChanged(sender As System.Object, e As System.EventArgs) Handles CheckBox1.CheckedChanged, CheckBox2.CheckedChanged, CheckBox3.CheckedChanged
    
            Dim mySender As CheckBox = DirectCast(sender, CheckBox)
            For Each myControl As CheckBox In Panel1.Controls
                RemoveHandler myControl.CheckedChanged, AddressOf CheckBox1_CheckedChanged
                If myControl.Name = mySender.Name Then
                    myControl.Checked = True
                Else
                    myControl.Checked = False
    
                End If
                AddHandler myControl.CheckedChanged, AddressOf CheckBox1_CheckedChanged
            Next
    
        End Sub
    More important than the will to succeed, is the will to prepare for success.

    Please rate the posts, your comments are the fuel to keep helping people

  5. #5
    Wall Poster TysonLPrice's Avatar
    Join Date
    Sep 2002
    Location
    Columbus, Ohio
    Posts
    3,835

    Re: Checkboxes behave as radio buttons

    Old fashioned clunky control freak way.

    Code:
    	Private Sub CheckBox1_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox1.CheckedChanged
    		If CheckBox1.Checked = True Then
    			CheckBox2.Checked = False
    			CheckBox3.Checked = False
    			CheckBox4.Checked = False
    		End If
    	End Sub
    
    	Private Sub CheckBox2_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox2.CheckedChanged
    		If CheckBox2.Checked = True Then
    			CheckBox1.Checked = False
    			CheckBox3.Checked = False
    			CheckBox4.Checked = False
    		End If
    	End Sub
    
    	Private Sub CheckBox3_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox3.CheckedChanged
    		If CheckBox3.Checked = True Then
    			CheckBox1.Checked = False
    			CheckBox2.Checked = False
    			CheckBox4.Checked = False
    		End If
    	End Sub
    
    	Private Sub CheckBox4_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox4.CheckedChanged
    		If CheckBox4.Checked = True Then
    			CheckBox1.Checked = False
    			CheckBox2.Checked = False
    			CheckBox3.Checked = False
    		End If
    	End Sub
    Please remember next time...elections matter!

  6. #6
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: Checkboxes behave as radio buttons

    Why would it be necessary to remove and add event handlers for this?

  7. #7
    PowerPoster kaliman79912's Avatar
    Join Date
    Jan 2009
    Location
    Ciudad Juarez, Chihuahua. Mexico
    Posts
    2,593

    Re: Checkboxes behave as radio buttons

    And using a status variable:
    Code:
        Private Sub CheckBox1_CheckedChanged(sender As System.Object, e As System.EventArgs) Handles CheckBox1.CheckedChanged, CheckBox2.CheckedChanged, CheckBox3.CheckedChanged
            Static bolChanging As Boolean = False
            If Not bolChanging Then
                bolChanging = True
                Dim mySender As CheckBox = DirectCast(sender, CheckBox)
                For Each myControl As CheckBox In Panel1.Controls
                    myControl.Checked = False
                Next
                mySender.Checked = True
                bolChanging = False
            End If
        End Sub
    More important than the will to succeed, is the will to prepare for success.

    Please rate the posts, your comments are the fuel to keep helping people

  8. #8
    PowerPoster kaliman79912's Avatar
    Join Date
    Jan 2009
    Location
    Ciudad Juarez, Chihuahua. Mexico
    Posts
    2,593

    Re: Checkboxes behave as radio buttons

    Quote Originally Posted by kleinma View Post
    Why would it be necessary to remove and add event handlers for this?
    Because, if you change the checked property inside the CheckedChange event handler, that action will trigger the handler again, in an infinite recursive loop.
    More important than the will to succeed, is the will to prepare for success.

    Please rate the posts, your comments are the fuel to keep helping people

  9. #9
    VB For Fun Edgemeal's Avatar
    Join Date
    Sep 2006
    Location
    WindowFromPoint
    Posts
    4,255

    Re: Checkboxes behave as radio buttons

    Quote Originally Posted by henrikl View Post
    i can’t use radio buttons because, my checkboxes are user controls with some extra features.
    code remove!
    Last edited by Edgemeal; Aug 27th, 2015 at 09:23 PM.

  10. #10
    Hyperactive Member Vexslasher's Avatar
    Join Date
    Feb 2010
    Posts
    429

    Re: Checkboxes behave as radio buttons

    It works better if you do it from the click event instead of the checkchanged this is all you would need.

    Code:
        Private Sub CheckBox1_Click(sender As Object, e As EventArgs) Handles CheckBox1.Click, CheckBox2.Click, CheckBox3.Click, CheckBox4.Click
            Dim mySender As CheckBox = DirectCast(sender, CheckBox)
            For Each Cb As CheckBox In Me.Controls.OfType(Of CheckBox)()
                Cb.Checked = False
            Next
            mySender.Checked = True
        End Sub

  11. #11
    PowerPoster kaliman79912's Avatar
    Join Date
    Jan 2009
    Location
    Ciudad Juarez, Chihuahua. Mexico
    Posts
    2,593

    Re: Checkboxes behave as radio buttons

    Quote Originally Posted by Edgemeal View Post
    how bout,
    Code:
    ' User Control with a checkbox that acts like a radio button.
    
    Public Class UC
        ' check box click,
        Private Sub CheckBox1_Click(sender As Object, e As System.EventArgs) Handles CheckBox1.Click
            ' get list of usercontrols of same type in the same parent/container.
            Dim ucs = Me.Parent.Controls.OfType(Of UC)()
            ' loop thru user controls
            For Each uc As UC In ucs
                ' if UC is NOT Me then,
                If uc.Name <> Me.Name Then
                    ' get list of checkboxes in this uc,
                    Dim checkBoxes = uc.Controls.OfType(Of CheckBox)()
                    ' loop thru check box list,
                    For Each chkBox As CheckBox In checkBoxes
                        ' if has same name as this checkbox then uncheck it!
                        If chkBox.Name = Me.CheckBox1.Name Then
                            chkBox.Checked = False
                        End If
                    Next
                End If
            Next
        End Sub
    
    End Class
    For each uc As UC ?

    This will have the infinite recursive problem also. Provided you add all Checkboxe's click events to the handles clause.
    More important than the will to succeed, is the will to prepare for success.

    Please rate the posts, your comments are the fuel to keep helping people

  12. #12
    PowerPoster kaliman79912's Avatar
    Join Date
    Jan 2009
    Location
    Ciudad Juarez, Chihuahua. Mexico
    Posts
    2,593

    Re: Checkboxes behave as radio buttons

    Quote Originally Posted by Vexslasher View Post
    It works better if you do it from the click event instead of the checkchanged this is all you would need.

    Code:
        Private Sub CheckBox1_Click(sender As Object, e As EventArgs) Handles CheckBox1.Click, CheckBox2.Click, CheckBox3.Click, CheckBox4.Click
            Dim mySender As CheckBox = DirectCast(sender, CheckBox)
            For Each Cb As CheckBox In Me.Controls.OfType(Of CheckBox)()
                Cb.Checked = False
            Next
            mySender.Checked = True
        End Sub
    Sort of, what if the user changes the status of the checked property with the keyboard?
    More important than the will to succeed, is the will to prepare for success.

    Please rate the posts, your comments are the fuel to keep helping people

  13. #13
    PowerPoster kaliman79912's Avatar
    Join Date
    Jan 2009
    Location
    Ciudad Juarez, Chihuahua. Mexico
    Posts
    2,593

    Re: Checkboxes behave as radio buttons

    Quote Originally Posted by kleinma View Post
    To add to this, you can filter the controls to just the type you care about in the loop like this:
    Code:
            For Each C As CheckBox In myPanel.Controls.OfType(Of CheckBox)()
    
            Next
    This is true, although I was assuming all controls inside the panel were CheckBoxes
    More important than the will to succeed, is the will to prepare for success.

    Please rate the posts, your comments are the fuel to keep helping people

  14. #14
    Hyperactive Member Vexslasher's Avatar
    Join Date
    Feb 2010
    Posts
    429

    Re: Checkboxes behave as radio buttons

    Quote Originally Posted by kaliman79912 View Post
    Sort of, what if the user changes the status of the checked property with the keyboard?
    It still works perfectly you can use the keyboard or the mouse doesn't matter.

  15. #15
    VB For Fun Edgemeal's Avatar
    Join Date
    Sep 2006
    Location
    WindowFromPoint
    Posts
    4,255

    Re: Checkboxes behave as radio buttons

    Quote Originally Posted by kaliman79912 View Post
    For each uc As UC ?

    This will have the infinite recursive problem also. Provided you add all Checkboxe's click events to the handles clause.
    I think i got the wrong idea, I was going across multiple usercontrols, never mind LOL!
    Last edited by Edgemeal; Aug 27th, 2015 at 09:24 PM.

  16. #16
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: Checkboxes behave as radio buttons

    Quote Originally Posted by kaliman79912 View Post
    Because, if you change the checked property inside the CheckedChange event handler, that action will trigger the handler again, in an infinite recursive loop.
    Not if you cast the sender to checkbox and check to see if it is checked or not before taking action.

  17. #17
    PowerPoster kaliman79912's Avatar
    Join Date
    Jan 2009
    Location
    Ciudad Juarez, Chihuahua. Mexico
    Posts
    2,593

    Re: Checkboxes behave as radio buttons

    Quote Originally Posted by Vexslasher View Post
    It still works perfectly you can use the keyboard or the mouse doesn't matter.
    The keyboard will not trigger the Click event
    More important than the will to succeed, is the will to prepare for success.

    Please rate the posts, your comments are the fuel to keep helping people

  18. #18
    PowerPoster kaliman79912's Avatar
    Join Date
    Jan 2009
    Location
    Ciudad Juarez, Chihuahua. Mexico
    Posts
    2,593

    Re: Checkboxes behave as radio buttons

    Quote Originally Posted by kleinma View Post
    Not if you cast the sender to checkbox and check to see if it is checked or not before taking action.
    I may be off here, but lets say CB2 is checked (of course none others are), then the users checks CB1. At that moment the handler will be trigered and start the process. It iwll check to see if CB2 is checked and since it is, and it should not be, then it changes the status. This will trigger the CheckedChange event now for CB2 and start it all again. But now, the sender is CB2 so how can we diferentiate from the first recursion of the sub? how can we know now that the purpose of the handler is to leave the sender unchecked when on the first recursion it was the other way around?
    More important than the will to succeed, is the will to prepare for success.

    Please rate the posts, your comments are the fuel to keep helping people

  19. #19
    Hyperactive Member Vexslasher's Avatar
    Join Date
    Feb 2010
    Posts
    429

    Re: Checkboxes behave as radio buttons

    Quote Originally Posted by kaliman79912 View Post
    The keyboard will not trigger the Click event
    It does I press space bar and that works..

  20. #20
    PowerPoster kaliman79912's Avatar
    Join Date
    Jan 2009
    Location
    Ciudad Juarez, Chihuahua. Mexico
    Posts
    2,593

    Re: Checkboxes behave as radio buttons

    Quote Originally Posted by Vexslasher View Post
    It does I press space bar and that works..
    Sorry, you are right, The sub I created to test it had only one checkBox click event handled and was not doing it for the rest. duh!
    More important than the will to succeed, is the will to prepare for success.

    Please rate the posts, your comments are the fuel to keep helping people

  21. #21
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: Checkboxes behave as radio buttons

    Quote Originally Posted by kaliman79912 View Post
    I may be off here, but lets say CB2 is checked (of course none others are), then the users checks CB1. At that moment the handler will be trigered and start the process. It iwll check to see if CB2 is checked and since it is, and it should not be, then it changes the status. This will trigger the CheckedChange event now for CB2 and start it all again. But now, the sender is CB2 so how can we diferentiate from the first recursion of the sub? how can we know now that the purpose of the handler is to leave the sender unchecked when on the first recursion it was the other way around?
    So lets say you have 4 checkboxes on a form and you want them to act like radiobuttons. This is how I would code it, and it does not get stuck in recursion, and it does not require me to add and remove event handlers.

    Code:
        Private Sub AnyCheckbox_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox1.CheckedChanged, CheckBox2.CheckedChanged, CheckBox3.CheckedChanged, CheckBox4.CheckedChanged
    
            'GET CHECKBOX THAT INITIATED EVENT FIRING
            Dim SenderCB As CheckBox = DirectCast(sender, CheckBox)
            'WE ONLY CARE TO DO SOMETHING WHEN A CHECKBOX GETS CHECKED (NOT UNCHECKED)
            'SO EXIT THE EVENT HANDLER IF OUR SENDER IS NOT CHECKED
            If Not SenderCB.Checked Then Return
    
            'LOOP ALL CHECKBOXES IN CONTAINER AND UNCHECK THEM IF THEY ARE CHECKED AND
            'ALSO IF THEY ARE NOT THE SENDER THAT INITIATED THIS EVENT
            For Each CB As CheckBox In Me.Controls.OfType(Of CheckBox)()
                If CB.Checked AndAlso CB IsNot sender Then
                    CB.Checked = False
                End If
            Next
    
        End Sub

  22. #22
    Sinecure devotee
    Join Date
    Aug 2013
    Location
    Southern Tier NY
    Posts
    6,582

    Re: Checkboxes behave as radio buttons

    It seems like the code in post 7 could be simplified.
    You'll get the checkedChanged first on the one that is just checked.
    So check to see if it is checked then reset the ones that are not it.
    Code:
      Private Sub CheckBox1_CheckedChanged(sender As System.Object, e As System.EventArgs) Handles CheckBox1.CheckedChanged, CheckBox2.CheckedChanged, CheckBox3.CheckedChanged
        Dim mySender As CheckBox = DirectCast(sender, CheckBox)
        If mySender.Checked Then
          For Each myControl As CheckBox In Panel1.Controls
            If mySender IsNot myControl Then myControl.Checked = False
          Next
        End If
      End Sub
    Edit: I guess I was a bit slow on getting that posted....

  23. #23
    PowerPoster kaliman79912's Avatar
    Join Date
    Jan 2009
    Location
    Ciudad Juarez, Chihuahua. Mexico
    Posts
    2,593

    Re: Checkboxes behave as radio buttons

    Yes, you are correct, This approach is similar to the one using a boolean variable as a status, because the procedure is triggered, you just decide inside the code that nothing should be done in some cases. yours is better in the respect that it will only call the handler one more time as there is only one checkBox that can be checked in this scenario.
    More important than the will to succeed, is the will to prepare for success.

    Please rate the posts, your comments are the fuel to keep helping people

  24. #24
    You don't want to know.
    Join Date
    Aug 2010
    Posts
    4,578

    Re: Checkboxes behave as radio buttons

    If I had to pick one of these approaches, I'd use what #2 and #3 are suggesting. #5 is pretty horrid, and I don't even feel like evaluating #9 because it looks so complex I'd immediately look for another solution.

    Here's what I'd do.

    We have four choices, but only want one to be True at a given time. I'm thinking this is like we're choosing some toppings for some ice cream, but the store is cheap and only lets you pick one. I started imagining how I'd represent this as a type with 4 Boolean properties and setters that enforce only 1 is true, but I quickly ended up in the same kind of looping problem we're trying to avoid. Hm.

    But then I realized we're selecting one thing, then updating a set of controls based on that one selection. That's far easier to deal with because we can ignore CheckedChanged when it's an "uncheck" event. For brevity, I'll use two checkboxes, and our toppings will be "Hot Fudge" and "Caramel".

    Code:
    Public Class Form1
    
        Private _selectedTopping As String
    
        Sub New()
            InitializeComponent()
    
            ' My 'Caramel' checkbox was the first.
            SelectTopping("Caramel")
        End Sub
    
        Private Sub SelectTopping(ByVal topping As String)
            _selectedTopping = topping
    
            chkCaramel.Checked = (_selectedTopping = "Caramel")
            chkHotFudge.Checked = (_selectedTopping = "Hot Fudge")
        End Sub
    
        Private Sub chkCaramel_CheckedChanged(sender As Object, e As EventArgs) Handles chkCaramel.CheckedChanged
            If chkCaramel.Checked Then
                SelectTopping("Caramel")
            End If
        End Sub
    
        Private Sub chkHotFudge_CheckedChanged(sender As Object, e As EventArgs) Handles chkHotFudge.CheckedChanged
            If chkHotFudge.Checked Then
                SelectTopping("Hot Fudge")
            End If
        End Sub
    
    End Class
    Now, this is a bit tedious for multiple checkboxes. If you opt to make the text of the checkbox the "name" of the selected topping, we can condense:

    Code:
    Public Class Form1
    
        Private _selectedTopping As String
        Private _toppings() As CheckBox
    
        Sub New()
            InitializeComponent()
    
            _toppings = {chkCaramel, chkHotFudge}
            For Each chkTopping In _toppings
                AddHandler chkTopping.CheckedChanged, AddressOf topping_CheckedChanged
            Next
    
            SelectTopping(_toppings(0).Text)
        End Sub
    
        Private Sub SelectTopping(ByVal topping As String)
            _selectedTopping = topping
    
            For Each chkTopping As CheckBox In _toppings
                chkTopping.Checked = (chkTopping.Text = _selectedTopping)
            Next
        End Sub
    
        Private Sub topping_CheckedChanged(sender As Object, e As EventArgs)
            Dim chkTopping = CType(sender, CheckBox)
            If chkTopping.Checked Then
                SelectTopping(chkTopping.Text)
            End If
        End Sub
    
    End Class
    I really wanted to show an approach that separated UI and logic, but it'd take more time than I think I have right now. I can see the solution in terms of WPF, but getting the same thing in terms of Windows Forms doesn't seem inherently easy. And it definitely looks silly in the isolated context of this example.

    *edit*
    I lied. Here you go, the enterprisey as heck way to do this. I still think there's a better way I haven't quite nailed down yet that doesn't have to rely on the text of the UI controls, but every time I lay out the 4-boolean version of the Controller I want to gag:

    Code:
    Imports System.ComponentModel
    Imports System.Runtime.CompilerServices
    
    Public Class Form1
    
        Private _controller As Form1Controller
        Private _toppingBoxes() As CheckBox
    
        Sub New()
            InitializeComponent()
            InitializeToppingBoxes()
    
            _controller = New Form1Controller()
            AddHandler _controller.PropertyChanged, AddressOf HandleControllerPropertyChanged
    
            _controller.SelectedTopping = "Caramel"
        End Sub
    
        Private Sub InitializeToppingBoxes()
            _toppingBoxes = {chkCaramel, chkHotFudge}
            For Each toppingBox In _toppingBoxes
                AddHandler toppingBox.CheckedChanged, GenerateCheckHandler(toppingBox)
            Next
        End Sub
    
        Private Sub UpdateToppings()
            For Each toppingBox In _toppingBoxes
                toppingBox.Checked = toppingBox.Name = _controller.SelectedTopping
            Next
        End Sub
    
        Private Function GenerateCheckHandler(ByVal checkBox As CheckBox) As EventHandler
            Return Sub(sender, e)
                       If checkBox.Checked Then
                           _controller.SelectedTopping = checkBox.Name
                       End If
                   End Sub
        End Function
    
        Private Sub HandleControllerPropertyChanged(sender As Object, e As PropertyChangedEventArgs)
            Select Case e.PropertyName
                Case "SelectedTopping"
                    UpdateToppings()
            End Select
        End Sub
    
    End Class
    
    Public Class Form1Controller
        Implements INotifyPropertyChanged
    
        Private _selectedTopping As String
        Public Property SelectedTopping As String
            Get
                Return _selectedTopping
            End Get
            Set(value As String)
                If _selectedTopping <> value Then
                    _selectedTopping = value
                    RaisePropertyChanged()
                End If
            End Set
        End Property
    
        Protected Sub RaisePropertyChanged(<CallerMemberName> Optional ByVal propertyName As String = "")
            RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(propertyName))
        End Sub
    
        Public Event PropertyChanged As PropertyChangedEventHandler Implements INotifyPropertyChanged.PropertyChanged
    
    End Class
    Last edited by Sitten Spynne; Aug 27th, 2015 at 04:45 PM.
    This answer is wrong. You should be using TableAdapter and Dictionaries instead.

  25. #25

    Thread Starter
    Addicted Member
    Join Date
    Jul 2012
    Location
    Denmark
    Posts
    216

    Re: Checkboxes behave as radio buttons

    Thank you all.

    I have read all posts with interest.

    Kaliman79912
    You are right about the infinite recursive loop. That was my problem from the beginning.

    Kleinma
    Whit your solution I must click twice to get a checkbox checked. That was also a problem I was facing with my own code.

    Passel
    Your solution works perfect and is very short.

    Thank you again,
    Henrik

    Here is what I ended up with
    Code:
        Private Sub frmMain_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
            For Each Nchk As Control In NpanSettings.Controls.OfType(Of PicCheckBox)()
                AddHandler DirectCast(Nchk, PicCheckBox).CheckedChanged, AddressOf NchkCheckChanged
            Next
        End Sub
    
        Private Sub NchkCheckChanged(ByVal sender As Object, ByVal e As EventArgs)
            If Initializing Then Return
            Dim SenderCB As PicCheckBox = DirectCast(sender, PicCheckBox)
            If SenderCB.Checked Then
                For Each chk As PicCheckBox In NpanSettings.Controls.OfType(Of PicCheckBox)()
                    If SenderCB IsNot chk Then chk.Checked = False
                Next
            End If
        End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width