locked
Button Code to Turn on Picture in Picture Box RRS feed

  • Question

  • I am having trouble with this button code probem:  I have a button and when I click that button I want it to turn a picture in a picturebox to true to make it visible.  I feel dumb asking this ? but have tried a few options and can't get it.  Can someone help me with the code for the button?

    Friday, June 11, 2010 5:14 PM

Answers

  • PictureBox1.Visible =

    False

     

    If Button2Click ----This is where I am currently drawing a blank.

    PictureBox1.Visible =

    True

    I have the buttons and picturebox properties and other code set except for this one task.

    • Marked as answer by rdgldr06 Friday, June 11, 2010 5:58 PM
    Friday, June 11, 2010 5:41 PM

All replies

  • Here is some code that reacts to the button click.

    btn_ok = Controls.AddButton("Ok",100,100)
    btn_end = Controls.AddButton("End",200,100)
    Controls.ButtonClicked = btnclk


    Sub btnclk
      If Controls.LastClickedButton = btn_ok Then
        GraphicsWindow.ShowMessage("Ok Clicked", "Ok Button")
      EndIf
      If Controls.LastClickedButton = btn_end Then
       program.End()
      EndIf
    EndSub

    Hope this helps.

    Friday, June 11, 2010 5:34 PM
  • PictureBox1.Visible =

    False

     

    If Button2Click ----This is where I am currently drawing a blank.

    PictureBox1.Visible =

    True

    I have the buttons and picturebox properties and other code set except for this one task.

    • Marked as answer by rdgldr06 Friday, June 11, 2010 5:58 PM
    Friday, June 11, 2010 5:41 PM
  • That was not the answer

        But I figured it out....took out the middle line.

    Friday, June 11, 2010 6:00 PM