CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7
  1. #1
    Join Date
    Jul 1999
    Posts
    22

    Cmd button not visible - strange problem

    Hi
    Click event of a command button has the following code :
    Unload Form1
    Form1.Show


    When I click the cmd button the cmd button gets disappeared.
    Note:
    1) Designtime Visible property for this button is True.
    2) Nowhere in code I am setting the visible property of this control or its containers.

    Infact when I click this button is disappearing and also in its position I am seeing the form not its container. (It seems like a hole in that spot).

    Any suggestions.
    Thanks
    Manivannan


  2. #2
    Join Date
    May 1999
    Location
    Omika, Japan
    Posts
    729

    Re: Cmd button not visible - strange problem

    Hi,
    I was not able to reproduce this behavious!!.

    Is the command btn on the same form, ie Form1?
    In which case, i would go for
    Unload Me
    Form1.show '' **Even this is funny!?!

    Infact i was able to get it working for all 3 combinations. : (the btn is on Form1 itself)
    Unload me
    Form1.Show

    and
    Unload Form1
    Form1.show

    and
    Unload Me
    Me.Show

    Form1 shows at a different position on each click(because starup position is 3, set by Windows), showing that it is unloading and loading again!!!
    So, what is the problem?


  3. #3
    Join Date
    Jun 1999
    Location
    Switzerland
    Posts
    58

    Re: Cmd button not visible - strange problem

    Hi,

    Very strange! I can't reproduce this either.
    What if you delete the command and insert a new one on the form?
    What kind of project is this?

    Jan



  4. #4
    Join Date
    Jul 1999
    Posts
    34

    Re: Cmd button not visible - strange problem

    Hey! I don't know if this will help but, it helped me before with frames and textboxes.....left-click onto command button and set it to "bring to front"
    maybe that will help?


  5. #5
    Join Date
    Aug 1999
    Posts
    5

    Re: Cmd button not visible - strange problem

    You are using the Command Button to Unload the form and then again you are loading the form in the same event,which is not correct.Even then this
    should not happen
    Try this:
    unload Me
    Me.Show



  6. #6
    Join Date
    Jun 1999
    Location
    Switzerland
    Posts
    58

    Re: Cmd button not visible - strange problem

    Unload Form1
    DoEvents 'put this in and try.
    Form1.Show


  7. #7
    Join Date
    Jul 1999
    Location
    Athens, Hellas
    Posts
    769

    Re: Cmd button not visible - strange problem

    Use this:


    Unload Form1
    Form1.Show
    Form1.Refresh



    ;-)



    Michael Vlastos
    Company MODUS SA
    Development Department
    Athens, Greece
    Tel: +3-01-9414900

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

Featured