DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 10 of 10

Thread: Buttons appearing too quickly ...

  1. #1
    Join Date
    Apr 2004
    Location
    Hawaii
    Posts
    220

    Angry Buttons appearing too quickly ...

    VB6/XP, Hobby Programmer. I'm suddenly having a problem with a command button appearing before the rest of the form.

    ie. form1 loads form2 , then unloads itself. You play a little game on form2. When the game is over form2 does this 'form1.show', then unloads itself.

    It has worked great forever, then just recently I noticed the default command button for form1 will pop up (become visible) over the top of the form2 background graphic before form2 is unloaded, and before the entire form1 becomes visible.

    Can someone tell me how to keep this from happening? And maybe better yet, what I might have recently done to make it happen? I've been dabbling with this App for a long time and never had this problem. I did recently add a bunch of graphics to an imagelist on the form, but I tried removing all but one and no change.

    Any help appreciated.

    Shannon

  2. #2
    Join Date
    Jun 2009
    Posts
    135
    me.hide
    form1.show
    unload me



    Good Luck

  3. #3
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,663
    Can you zip up your project and attach it?

    I'd like to take a look.

  4. #4
    Join Date
    Apr 2004
    Location
    Hawaii
    Posts
    220
    VB5 ... when I read your post, I thought, "Duh". Then I tried it and it failed to stop the problem.

    I got the button to stop what I'm calling 'penetration' of my previous form by changing the tab index away from '0'. Apparently, being the first item in the tab index is what trigger it to appear so quickly. I hadn't noticed at the time of my first post, but I also have this graphic penetration issue with several other controls. Two small text boxes,. which when replaced with labels, ceased to have the problem. And now, two remaining up/dn controls are doing the same thing. I tried changing the tab index to very late, and replacing them with slider controls, but neither worked, as the slider controls exhibited the same behavior.

    I think I can remedy by making two little custom graphic buttons, but I'd really like to understand the 'why' of this situation, since as I said in post one, I don't recall this issue until recently. What could have changed to cause it?

    Still confused.

  5. #5
    Join Date
    Jun 2009
    Posts
    135
    try...
    me.hide
    doevents
    form1.show
    unload me



    Good Luck

  6. #6
    Join Date
    Apr 2004
    Location
    Hawaii
    Posts
    220
    Okay, I tried that ... interesting workaround (will remember this concept). Now what's happening is the form2 is being successfully hidden (first), but the little white boxes/buttons are now showing up OUTSIDE any VB form (just before redisplaying form1) and can be seen against my Desktop Wallpaper. LOL. I laugh because it was unexpected. What a pain this has become.

    Any other suggestions?

  7. #7
    Join Date
    Jun 2009
    Posts
    135
    All out! Don't know besides putting a me.visible = true in form load but I don't think that will help. Perhaps post your code so Hack can take a look...



    Good Luck

  8. #8
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,663
    Quote Originally Posted by hack View Post
    can you zip up your project and attach it?

    I'd like to take a look.
    It couldn't hurt...

  9. #9
    Join Date
    May 2004
    Location
    Duluth MN
    Posts
    353
    Try implementing a timer on form 1 that waits a second and then makes the form visible (then disables itself). In form2 do:

    Code:
    form1.timer1.enabled = true
    me.close
    Quote Originally Posted by Shannon View Post
    VB6/XP, Hobby Programmer. I'm suddenly having a problem with a command button appearing before the rest of the form.

    ie. form1 loads form2 , then unloads itself. You play a little game on form2. When the game is over form2 does this 'form1.show', then unloads itself.

    It has worked great forever, then just recently I noticed the default command button for form1 will pop up (become visible) over the top of the form2 background graphic before form2 is unloaded, and before the entire form1 becomes visible.

    Can someone tell me how to keep this from happening? And maybe better yet, what I might have recently done to make it happen? I've been dabbling with this App for a long time and never had this problem. I did recently add a bunch of graphics to an imagelist on the form, but I tried removing all but one and no change.

    Any help appreciated.

    Shannon

    ...joe

  10. #10
    Join Date
    Apr 2004
    Location
    Hawaii
    Posts
    220
    That's an idea, Joe, thanks!

    Hack, it's too big to just be passing around, and maybe more importantly, the last thing I would ever do is let an advanced programmer look at my elementary coding attempts.

Similar Threads

  1. Replies: 2
    Last Post: 04-10-2006, 03:31 PM
  2. buttons with templates and formview???
    By dave.potter@hol in forum .NET
    Replies: 2
    Last Post: 01-30-2006, 12:54 PM
  3. Formview - Templates - Buttons ???
    By dave.potter@hol in forum ASP.NET
    Replies: 0
    Last Post: 10-07-2005, 06:10 PM
  4. Dynamic Buttons disappearing
    By spudmasher in forum ASP.NET
    Replies: 3
    Last Post: 07-03-2005, 11:59 PM
  5. Replies: 0
    Last Post: 05-30-2001, 01:32 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center