Results 1 to 2 of 2

Thread: Help with Public (Variables? Constant? Public picturebox?)

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2011
    Posts
    13

    Exclamation Help with Public (Variables? Constant? Public picturebox?)

    Hello!

    I have a question, I can't really find the answer...

    Basically I have 2 Forms

    In form number 1 I have 2 pictureboxes. I want to create a checkbox in form2 that says if checkbox 1 is checked then show picture 1 in form 1

    I can't find the way to create those pictureoxes public..what am I doing wrong?

  2. #2
    Fanatic Member
    Join Date
    Jul 2009
    Posts
    629

    Re: Help with Public (Variables? Constant? Public picturebox?)

    You can not access the PictureBoxes like this?:
    Code:
    Form1.PictureBox1.Image
    Form1.PictureBox2.Image
    Called in the code of Form2:
    Code:
    If Me.CheckBox1.Checked Then
         Me.BackgroundImage = Form1.PictureBox1.Image
    Else
         Me.BackgroundImage = Form1.PictureBox2.Image
    End If
    The "Me" references to Form2.

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