Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. .NET (Core and Framework)
  4. picturebox.visible problem

picturebox.visible problem

Scheduled Pinned Locked Moved .NET (Core and Framework)
questionhelp
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    bimbambumbum
    wrote on last edited by
    #1

    Hi I'm a newbie struggling with a picturebox. At construction time I load a jpg image into a picturebox and I have 3 radio-buttons that dictate what what is drawn in the GUI. When the picturebox is enabled & visible at construction time then it stays visible even if I make it invisible later by pressing a radiobutton (picturebox1.visible = false) . Can someone please tell me what I'm missing? Regards Tom

    B 1 Reply Last reply
    0
    • B bimbambumbum

      Hi I'm a newbie struggling with a picturebox. At construction time I load a jpg image into a picturebox and I have 3 radio-buttons that dictate what what is drawn in the GUI. When the picturebox is enabled & visible at construction time then it stays visible even if I make it invisible later by pressing a radiobutton (picturebox1.visible = false) . Can someone please tell me what I'm missing? Regards Tom

      B Offline
      B Offline
      bimbambumbum
      wrote on last edited by
      #2

      Hmm, just solved it myself... when I replace: BitmapCanvas.Visible = false; With: this.BitmapCanvas.Visible = false; Then I can make the visible picturebox go invisible! Wonder why that is needed? Probably a no-brainer Thomas

      D L 2 Replies Last reply
      0
      • B bimbambumbum

        Hmm, just solved it myself... when I replace: BitmapCanvas.Visible = false; With: this.BitmapCanvas.Visible = false; Then I can make the visible picturebox go invisible! Wonder why that is needed? Probably a no-brainer Thomas

        D Offline
        D Offline
        DaveyM69
        wrote on last edited by
        #3

        This problem happens when you have a parameter or variable in a method that has the same name as the field of a class, such as:

        class MyClass
        {
        private int value;

        public MyClass(int value)
        {
            // value refers to the parameter
            // to use the field, as it has the same name, use this.value
            this.value = value;
        }
        

        }

        You can tell by hovering the mouse over value in the code editor.

        Dave
        Binging is like googling, it just feels dirtier. Please take your VB.NET out of our nice case sensitive forum. Astonish us. Be exceptional. (Pete O'Hanlon)
        BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)

        1 Reply Last reply
        0
        • B bimbambumbum

          Hmm, just solved it myself... when I replace: BitmapCanvas.Visible = false; With: this.BitmapCanvas.Visible = false; Then I can make the visible picturebox go invisible! Wonder why that is needed? Probably a no-brainer Thomas

          L Offline
          L Offline
          Luc Pattyn
          wrote on last edited by
          #4

          bimbambumbum wrote:

          BitmapCanvas.Visible = false;

          hover BitmapCanvas, right-click for "Go to definition" and see if that is what you expect it to be. :)

          Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum

          Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups