Results 1 to 5 of 5

Thread: [02/03] Weird Problem with Visibility

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    May 2005
    Posts
    181

    [02/03] Weird Problem with Visibility

    Hey. Ok I have this label on my forum that is my default set to be not visible. When the forum loads my program executes some code to check for new software updates. If there are any, it makes the label visible and allows the user to click on it and download the updates. This automatically opens a new forum called FrmUpdate. The thing is, this forum looks all greyed out and eventually I run into an error where it says that "an external component has thrown an exception". Now if I set the label to be by default visible in the properties, then I don't have this problem. I don't understand why this is happening, because either way I am eventually making the label visible. It's just weird that the default visible is screwing it up.. Any ideas why?

    Thanks
    John

  2. #2
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,109

    Re: [02/03] Weird Problem with Visibility

    Have you tried stepping through the code from the time you click on the label? That might show you where the problem is.
    My usual boring signature: Nothing

  3. #3
    Hyperactive Member ZaNi's Avatar
    Join Date
    Jun 2006
    Location
    Australia
    Posts
    360

    Re: [02/03] Weird Problem with Visibility

    Sounds like the reason visibility is messing up your code is that you have an if statement based on the visibility of the label somewhere. As for the solution to that, I couldn't guess at that without seeing some code...
    * Don't limit yourself to sanity
    * I'd rather be optimistic and naive than pessimistic and right
    * Ask good questions, get good answers.

    My Codebank submissions:
    How to write one rountine to handle many events
    Accessing and Using variables across multiple forms
    Printing/Previewing a form or control

    Links I've "borrowed" from other people:
    vbdotnetboy - Awesome site for tips

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    May 2005
    Posts
    181

    Re: [02/03] Weird Problem with Visibility

    I'm not to sure how to use the debugging mode. And I dont have any if statements that depend on visibility. Here's the code for the label:

    VB Code:
    1. If (labelInformationSystem.BackColor.Equals(Color.Yellow)) Then
    2.             If fu Is Nothing Then
    3.                 fu = New FormUpdate
    4.             End If
    5.             fu.ShowDialog()
    6.         End If

    I know that that part deals with color, but either way when it comes to determining the color of the label, the label has already been turned visible. I have code that makes it visible after a certain amount of time. The real problem just simply steps from If I set it to visible or invisible when i'm in regular design mode. Any ideas?

    John

  5. #5
    Hyperactive Member ZaNi's Avatar
    Join Date
    Jun 2006
    Location
    Australia
    Posts
    360

    Re: [02/03] Weird Problem with Visibility

    It sounds like there's some code somewhere in your program that isn't doing what you want... without a more detailed look at the program, it is hard to know where to begin...

    I suggest you have a quick look at jmcilhinney's profile with all the tutorials... I lifted this article from there. It should get you going with debugging, which is learning to fish as opposed to being fed a fish I keep jmcilhinney's profile on tap in case I run into problems... Might I suggest the same?
    * Don't limit yourself to sanity
    * I'd rather be optimistic and naive than pessimistic and right
    * Ask good questions, get good answers.

    My Codebank submissions:
    How to write one rountine to handle many events
    Accessing and Using variables across multiple forms
    Printing/Previewing a form or control

    Links I've "borrowed" from other people:
    vbdotnetboy - Awesome site for tips

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