Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > General > Flicker issue


Reply
 
Thread Tools Display Modes
  #1  
Old 10-16-2005, 03:26 AM
ben_b ben_b is offline
Regular
 
Join Date: Oct 2004
Posts: 59
Default Flicker issue


This is a fairly hard issue that I’ve been working on, on and off all day today and I finally giving in and posting here about it. The code I’m working with is:

Code:
Private Sub cmdBack_Click()
    'Show frmMaintenance
    frmMaintenance.Show

    'Set frmMaintenance window position so they're the same when you press back
    Dim intTop As Integer, intLeft As Integer
    
    ''Get current form window position
    intTop = Me.Top
    intLeft = Me.Left
    
    ''Set frmMaintenance window position
    frmMaintenance.Top = intTop
    frmMaintenance.Left = intLeft
    
    'Close current form
    Unload Me
End Sub
As you can see what this code is supposed to do is set the form it’s going back too’s position to the same as the current forms window position but the problem is if the form has been moved from its start up position, when I push the back button it flickers while it’s moving the form. Does anyone know of a way to prevent the flicker and or set the window position before it actually switches to it?
Reply With Quote
  #2  
Old 10-16-2005, 03:38 AM
vbfan's Avatar
vbfan vbfan is offline
Senior Contributor
 
Join Date: Dec 2002
Location: Saxony, Germany
Posts: 1,216
Default

Try to set AutoRedraw to true of the Form. And ben please don't start for every question you have a new thread( I know you're surely new to vb and you want to discover as many as possible). Please try at first a search and see if you get results, and if they help you. If they don't help you then you can/should start a new thread. Some Questions are really FAQ and you'll find dozens of answers.
Reply With Quote
  #3  
Old 10-16-2005, 03:47 AM
ben_b ben_b is offline
Regular
 
Join Date: Oct 2004
Posts: 59
Default

I knew I'd get a little heat over posting all my questions at once but I've been building them up over the last week or so and I decided for tracking purposes it'd be best if I posted seperate threads rather than one thread. All of these questions I've searched for answers exstensivly throughout the internet but couldn't find any sollutions.

Anyways thanks for the help I'll try the AutoRedraw.
Reply With Quote
  #4  
Old 10-16-2005, 03:50 AM
vbfan's Avatar
vbfan vbfan is offline
Senior Contributor
 
Join Date: Dec 2002
Location: Saxony, Germany
Posts: 1,216
Default

I didn't mean you should create only one big collection thread with all your Questions in it, rather that you should do a search before opening a new thread. And in this forum you find many things and also for your questions, so next time try a search here and be surprised what you can find here!
Much luck with your programming
Reply With Quote
  #5  
Old 10-16-2005, 03:54 AM
ben_b ben_b is offline
Regular
 
Join Date: Oct 2004
Posts: 59
Default

Also the AutoRedraw didn't work. The only way I can seem to prevent the flicker is if I set the form StartUpPosition to Manual but I'm having troulbe with that. Unless I can get it to change the StartUpPosition once it's running (which I was having trouble with) I can't do it that way because I need the form to first load centered then be manual to allow the changes to occur. Hopefully that made sense.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->