Community discussion forum

Events & Methods

  • 2 years ago

     Hi all, im having issues with event's and methods.

    I have 2 forms, for example form1 and form 2. on form 1 i have a label and on form 2 i have a check box. what im trying to achieve is when the check box is checked in form 2, for the label1.visible=false to be called, im looking for an explanation so that i can better further my knowledge with vb.Net.

    Thanks in advance

    domino.vbcoder

  • 2 years ago

    Just as long as the forms are in the same app, then just use:

    If Me.checkbox1.checked Then

    Form1.label1.visible = false

    You can do this the other way around if you want:

    If Form2.checkbox1.checked Then

    Me.label1.visible = false

    Exploit the MSDN library for knowledge on VB.NET et al

  • 2 years ago

    [quote user="D'Scouser"]

    Just as long as the forms are in the same app, then just use:

    If Me.checkbox1.checked Then

    Form1.label1.visible = false

    You can do this the other way around if you want:

    If Form2.checkbox1.checked Then

    Me.label1.visible = false

    Exploit the MSDN library for knowledge on VB.NET et al

    [/quote] 

     

    Or, you can cut it down to a single line:

    Form1.Label1.Visible = Form2.CheckBox1.Checked

     Works as long as you haven't got the checkbox set to Tri-State.
     

Post a reply

Enter your message below

Sign in or Join us (it's free).

We'd love to hear what you think! Submit ideas or give us feedback