none
How to hide or delete an image when pressing a button.

    Question

  • Hello,

    So I have a calculate button that has an image appear on the screen with text etc... there is also a clear button that clears the text from the screen, how can I make it so that it'll also clear the image that appeared until the user hits the calculate button again?

    Friday, December 08, 2017 1:02 AM

All replies

  • Hi,

    im = ImageList.LoadImage("https://www.planwallpaper.com/static/images/9-credit-1.jpg")
    image = Shapes.AddImage(im) 'image
    Shapes.Move(image,200,200)
    button = Controls.AddButton("Clear",100,100) 'button
    Controls.ButtonClicked = OnButtonClicked
    Sub OnButtonClicked
      If Controls.LastClickedButton = button Then
        'Shapes.HideShape(image) ---> for hiding
        Shapes.Remove(image) '---> for removing
      EndIf  
    EndSub  

    Use 

    Shapes.HideShape()

    for hiding

    Use

    Shapes.Remove()

    for removing

    Thanks,



    Roshan - 7th Grade Student (Age 11) - Learning Small Basic and Visual Basic

    Friday, December 08, 2017 1:56 AM