Events & Methods

  • 13 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

  • 13 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

  • 13 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).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Memory is like an orgasm. It's a lot better if you don't have to fake it.” - Seymour Cray