checkbox problem

Can anyone help me find information on how to handle check boxes and groupboxes I'm new to visual basic. Any suggestions are much appreciated.
Thanks a lot in advance
Alex



Answer this question

checkbox problem

  • Mechanimal82

    I'm interested in knowing more about the property that tells either the CB is checked or not. If i double click on a check box in design view it redirects me to the checked_change code. How do I access that other property I'm using if statments applied to Databinded labels to figure out if a check box is checked or not. Sorry If this sounds to naive.



  • Hirén

    I doubt it. You'd use radio buttons to let the user select one of a few choices. You'd usually update a database table with a control that the user clicks to say she's done. Like a button named "Submit".

    A form doesn't have a Validate method. A web page does. I'm not up to speed on System.Web but I'd guess you want to call Me.Validate before updating the database. That would give the various controls in the page a chance to throw an exception if the user entered invalid data. Again, just a guess...


  • esamsalah

    Thanxs for that. So, if I want to have a groupbox where only one option can be selected then I must use radio buttons inside a groupbox I was trying it with checkboxes and if statments and it was just not working. Need to learn more about the subject.
    Again thanks


  • bahar..

    You've got it. Use radiobuttons inside a groupbox.


  • amzzz

    Nobugz, just one more question: I'm using radio buttons now. Is it ok to include the endedit and the tableadapter.update inside the radiobutton_CheckedChanged code

    Private Sub PagoRadioButton_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PagoRadioButton.CheckedChanged
    Me.PinturasDBBindingSource.EndEdit()
    Me.PinturasDBTableAdapter.Update(Me.PinturasDataSet.PinturasDB)
    End Sub

    What about me.validate What is it for (i really am new to vb)
    should I include it everytime I want data to be saved (sorry if my question isn't making any sense ).
    Thank you for helping


  • soni_ravi362000

    I see what you mean. But, Ive noticed that when you create a databased form by dragging a datatable from data sources (i'm using Visual studio 2005) into the form it automatically generates a binding navigator which includes a save button and the code for that button goes something like this:
    Me.Validate()
    Me.MediaBindingSource.EndEdit()
    Me.MediaTableAdapter.Update(Me.PinturasDataSet.Media)
    Anyway, up to now I have been only working with forms and have never included the 'validate' statment in the code; things seem to work fine that way.
    Thanx for your help
    Alex



  • BerryB

    Be careful not to mix up checkboxes and radiobuttons. A groupbox is pretty much designed to host a set of radiobuttons. The fact that they live inside a groupbox helps Windows decide which radiobuttons get unselected when you click on one. Checkboxes have no such behavior. Although you can make it work that way with the Click event. But that would confuse the user...


  • scepticus

    What part do you want to know Checkboxes have a property to tell you if they are checked, and fire an event when they change. If you google with site:msdn.microsoft.com, you can search the microsoft docs for more info.



  • checkbox problem