label.visible

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • dcstech

    label.visible

    I have a label that will not display. On the form load event I wrote
    "label1.visible =false".
    when my routine get at the end of the code I inserted "label1.visible =true".
    I have had a similar problem with vba in excel and I had to put a wait
    statement after telling the label.visible=t rue. This solved the problem in
    Excel. In VB.Net I used the thread.sleep after telling the label.visble=tr ue
    and this did not help.

    When I said "wait" I am only talking about 1 second the same for sleep.

    Thanks for any help.
    DCSTech
  • Jeff Dillon

    #2
    Re: label.visible

    I created a new web project, and put a single label on it.

    In page_load I can easily set visible=false or visible=true..a nd it works as
    expected

    Jeff

    "dcstech" <dcstech@discus sions.microsoft .com> wrote in message
    news:BC5DD751-E4C8-4C1A-86D0-E2702B26DAB9@mi crosoft.com...[color=blue]
    > I have a label that will not display. On the form load event I wrote
    > "label1.visible =false".
    > when my routine get at the end of the code I inserted[/color]
    "label1.visible =true".[color=blue]
    > I have had a similar problem with vba in excel and I had to put a wait
    > statement after telling the label.visible=t rue. This solved the problem[/color]
    in[color=blue]
    > Excel. In VB.Net I used the thread.sleep after telling the[/color]
    label.visble=tr ue[color=blue]
    > and this did not help.
    >
    > When I said "wait" I am only talking about 1 second the same for sleep.
    >
    > Thanks for any help.
    > DCSTech[/color]


    Comment

    • dcstech

      #3
      Re: label.visible

      This is on a windows form.

      "Jeff Dillon" wrote:
      [color=blue]
      > I created a new web project, and put a single label on it.
      >
      > In page_load I can easily set visible=false or visible=true..a nd it works as
      > expected
      >
      > Jeff
      >
      > "dcstech" <dcstech@discus sions.microsoft .com> wrote in message
      > news:BC5DD751-E4C8-4C1A-86D0-E2702B26DAB9@mi crosoft.com...[color=green]
      > > I have a label that will not display. On the form load event I wrote
      > > "label1.visible =false".
      > > when my routine get at the end of the code I inserted[/color]
      > "label1.visible =true".[color=green]
      > > I have had a similar problem with vba in excel and I had to put a wait
      > > statement after telling the label.visible=t rue. This solved the problem[/color]
      > in[color=green]
      > > Excel. In VB.Net I used the thread.sleep after telling the[/color]
      > label.visble=tr ue[color=green]
      > > and this did not help.
      > >
      > > When I said "wait" I am only talking about 1 second the same for sleep.
      > >
      > > Thanks for any help.
      > > DCSTech[/color]
      >
      >
      >[/color]

      Comment

      • ShaneB

        #4
        Re: label.visible

        Can you explain your code a bit more or post a sample that illustrates the
        problem?

        ShaneB
        [color=blue][color=green]
        >> "dcstech" <dcstech@discus sions.microsoft .com> wrote in message
        >> news:BC5DD751-E4C8-4C1A-86D0-E2702B26DAB9@mi crosoft.com...[color=darkred]
        >> > I have a label that will not display. On the form load event I wrote
        >> > "label1.visible =false".
        >> > when my routine get at the end of the code I inserted[/color]
        >> "label1.visible =true".[color=darkred]
        >> > I have had a similar problem with vba in excel and I had to put a wait
        >> > statement after telling the label.visible=t rue. This solved the
        >> > problem[/color]
        >> in[color=darkred]
        >> > Excel. In VB.Net I used the thread.sleep after telling the[/color]
        >> label.visble=tr ue[color=darkred]
        >> > and this did not help.
        >> >
        >> > When I said "wait" I am only talking about 1 second the same for sleep.
        >> >
        >> > Thanks for any help.
        >> > DCSTech[/color]
        >>
        >>
        >>[/color][/color]


        Comment

        • Nishith Pathak

          #5
          Re: label.visible

          I checked it in windows application and it is working fine for me.. May be
          check some other page events handlers

          regards
          Nishith


          Nishith

          "dcstech" wrote:
          [color=blue]
          > This is on a windows form.
          >
          > "Jeff Dillon" wrote:
          >[color=green]
          > > I created a new web project, and put a single label on it.
          > >
          > > In page_load I can easily set visible=false or visible=true..a nd it works as
          > > expected
          > >
          > > Jeff
          > >
          > > "dcstech" <dcstech@discus sions.microsoft .com> wrote in message
          > > news:BC5DD751-E4C8-4C1A-86D0-E2702B26DAB9@mi crosoft.com...[color=darkred]
          > > > I have a label that will not display. On the form load event I wrote
          > > > "label1.visible =false".
          > > > when my routine get at the end of the code I inserted[/color]
          > > "label1.visible =true".[color=darkred]
          > > > I have had a similar problem with vba in excel and I had to put a wait
          > > > statement after telling the label.visible=t rue. This solved the problem[/color]
          > > in[color=darkred]
          > > > Excel. In VB.Net I used the thread.sleep after telling the[/color]
          > > label.visble=tr ue[color=darkred]
          > > > and this did not help.
          > > >
          > > > When I said "wait" I am only talking about 1 second the same for sleep.
          > > >
          > > > Thanks for any help.
          > > > DCSTech[/color]
          > >
          > >
          > >[/color][/color]

          Comment

          • Sid

            #6
            Re: label.visible

            hi nishith,
            i had the sample problem, on the form i had put a new label, and it was
            not visible

            There is a workaround, open the code for the winform
            under the following tag
            <System.Diagnos tics.DebuggerSt epThrough()> Private Sub
            InitializeCompo nent()
            under the declaration of the label put this code

            Me.<your Label>.ForeColo r = System.Drawing. SystemColors.Co ntrolText
            You should be all set

            Cheers
            Sid

            Comment

            Working...