Question

How would I get rid of the flicker when I move the Sizing Bar?

Asked by: jefftwilley

This is a model that I built that I would like to implement into production. The horizontal bar between the mocked up subforms moves up and down resizing the subforms. When I use this same method using real subforms with data, I get terrible flicker. Anyone know a way to reduce this effect?

What I do know is that there aren't any events firing other than the sizing code that may cause it.

If it is inherent, then I can deal with it, but if its fixable, then chalk this one up as a win.

J

  • SubformSizer.mdb
    • 124 KB

    Simple Form with a horizontal bar between two subforms. The bar uses the MouseMove event to allow you to size the subforms.

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2009-11-03 at 14:41:55ID24869185
Tags

MS Access 2003

Topic

Microsoft Access Database

Participating Experts
4
Points
500
Comments
21

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. not the everyday flickering
    I am having a problem with flickering. But its not the kind of flickering that commonly occurs in animation (I dont think) I have a graphing application that is set up like this: i have a graph class that draws some things that are common in all the graphs (headings, axis,...
  2. Eliminate flicker
    I have a CDialogBar in my MDI program that has a bmp for a background. When I resized the program, it wouldnt redraw the bmp on the dialog bar. To fix that, I added this to my OnSize function: CDialogBar::OnSize(nType, cx, cy); CRect rect; this->GetClientRect(&rec...

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: DatabaseMXPosted on 2009-11-03 at 14:47:51ID: 25734742

How about:

Private Sub HBar_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    DoCmd.Echo False
    HBarStartX = X
    HBarStartY = Y
End Sub

and

Private Sub HBar_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
    HBarStartX = 0
    HBarStartY = 0
    Screen.MousePointer = nPointer
    DoCmd.Echo True
End Sub

mx

 

by: DatabaseMXPosted on 2009-11-03 at 14:48:37ID: 25734751

btw ... that is very cool.  Can I use that?

mx

 

by: DatabaseMXPosted on 2009-11-03 at 14:49:24ID: 25734762

Humm ... with the Echo off, you don't see movement ... but it does move :-(

mx

 

by: DatabaseMXPosted on 2009-11-03 at 14:54:54ID: 25734801

Although the mouse pointer does move ... so a least you can see where you are going ...

mx

 

by: jefftwilleyPosted on 2009-11-03 at 14:55:50ID: 25734806

Hey Joe,
Yea, its tricky. As are most MouseMove features of Access.

Feel free to steal and chop. I do need to solve this one in some fashion though. I even thought of removing the subform's recordsources while I size them, but there's still a slight flicker.

Let me know how you fare.

Its 5:00 here, and I'm gone for the day. I'll check back in later.

J

 

by: DatabaseMXPosted on 2009-11-03 at 14:59:44ID: 25734844

Fyi ... if you get Peters SS (which I am using) ... the paid version (almost free @ $42) has ALL the code ... and Peter is the master of Resizing ... you may find some tips:

http://www.peterssoftware.com/ss.htm

mx

 

by: DatabaseMXPosted on 2009-11-03 at 15:03:19ID: 25734866

Jeff ... is it supposed to work horizontally also ?  I'm not getting that to happen ...

mx

 

by: jefftwilleyPosted on 2009-11-03 at 15:04:49ID: 25734881

No, That's not a requirement (yet). Just up and down.

 

by: DatabaseMXPosted on 2009-11-03 at 15:07:04ID: 25734900

I'm adding some real subforms with data now.  

 

by: jefftwilleyPosted on 2009-11-09 at 08:45:21ID: 25777557

Any more ideas on this one Joe?

 

by: DatabaseMXPosted on 2009-11-09 at 09:13:31ID: 25777862

Well, I really could not get rid of the flicker with some real datasheets either.  And even Peter's resizer results in some flicker when resizing ... basically the flicker you are probably seeing.   Echo Off does not really seem to stop it ... and Peter does turn Echo off.

So, not sure what's next?

mx

 

by: jefftwilleyPosted on 2009-11-09 at 09:37:59ID: 25778103

Dunno,
I thought about hiding the subform while sizing, but that kind of defeats the purpose doesn't it. I may just have to live with it. Maybe I'll just port everything to .NET and call it a day. I have native controls there just for this purpose!!

I wonder these days about what M$ has in mind for Access...it seems that they would have integrated a lot of the activeX controls and things as simple as this sizing bar into their code a long time ago.

I'll leave the Q open a bit longer, maybe point Jim or Cap or some of the others at it and get their opinions?

J

 

by: DatabaseMXPosted on 2009-11-09 at 09:43:46ID: 25778157

"but that kind of defeats the purpose doesn't it"
Pretty much.

Yeah, it's too bad that Access is not a vector app ... like Flash can be :-)

mx

 

by: JDettmanPosted on 2009-11-10 at 06:40:19ID: 25785784

Try turning painting off on the form:

Me.Painting = False

JimD.

 

by: aikimarkPosted on 2009-11-10 at 06:43:46ID: 25785814

I haven't looked at the application details, but thought about these:

* only resize on MouseUp
* start timer to wait until no more size differences (between intervals) and then perform the actual resize code.  In other words, the resize event could simply update a datetime variable with Now().  The timer event could compare the last resize timestamp with the current timestamp and perform the actual resize if the interval was greater than some non-annoying value.

 

by: JDettmanPosted on 2009-11-10 at 06:50:44ID: 25785909

<<When I use this same method using real subforms with data, I get terrible flicker.>>

 One other thign came to mind and I'm not sure which version it was with, but one version did have problems with flicker if labels on the form were un-attached to a control.   I'll see if I can find the MSKB article...

JimD.

 

by: JDettmanPosted on 2009-11-10 at 06:52:52ID: 25785940

ah yes, it was with 2003 and it was with labels on tab controls.  The work around was to convert them to text controls.

JimD.

 

by: harfangPosted on 2009-11-10 at 07:36:31ID: 25786368

Hey Jeff,

I took a look, since you asked.

I'm assuming you want to display a datasheet. If you resize a datasheet, you get flicker. If you insert it into your form, you get only marginally more flicker. It is due to all the other events happening, but that's not much. And I can't see how you could get in your form anything better than what any datasheet gets elsewhere.


Slight improvement: never write to a property unless you really have to. e.g.

    Foo.Top = CalcValue
    If Foo.Top <> CalcValue Then Foo.Top = CalcValue

That can make a huge difference, depending on what events are being triggered by the property.


This doesn't seem to apply in your code, but if you change several metric properties, it's better to turn off painting before, set them all, and restart painting:

    Me.Subform1.Form.Painting = False


Slight improvement as well: use a continuous form. At least the form's stable elements will not flicker (only the content will). If you do, make sure no controls overlap (which can force a double redraw)


Finally, move the bar alone, and reset the form only when done, or only every 10 pixel, or only every 0.1 seconds (if needed), or only when the mouse has been immobile for 0.1 seconds. You can even enlarge the bar (to cover what will become invisible), and only collapse it back to a bar when you decide.

Drawback: you can only draw a subform object over another subform object. So you need to manage mouse events from a subform, affecting the main form. The subform only needs the detail section.

Advantage of the drawback: the subform becomes your "resize object", with all the related code in one place. If you need some events from the main form, you can trap them from "inside", using a "with events" variable, the same for every other control event concerning your bar.

Side benefit: it's a bit of fun to do it. Moving objects over a subform is intriguing...


That would be the end of my ideas.
(°v°)

 

by: jefftwilleyPosted on 2009-11-10 at 08:01:03ID: 25786643

Thanks to you all...I'll have some time today to give your ideas a test run. I'll report back my results and put this question to bed.
J

 

by: jefftwilleyPosted on 2009-11-10 at 14:58:21ID: 25790851

All,
I think we've got the answer(s)

================================================================
(°v°) Wrote:  Slight improvement: never write to a property unless you really have to. e.g.

    Foo.Top = CalcValue
    If Foo.Top <> CalcValue Then Foo.Top = CalcValue
================================================================
In the mouse move event, I store the Y value (vertical position) into a form level variable. I
Check the value of the variable against the current Y and if they are the same, I do nothing
if they are different, I am resizing. this reduced the majority of the pre-click flicker effect.

================================================================
JimD wrote:Try turning painting off on the form:

Me.Painting = False
================================================================
I turn it off in the MouseMove event (when Y doesn't = the Form Variable) before I run the
resize code, and back on when I'm done. This appears to have reduced the flicker well
enough to be live-able to both the users and me (I'm probably more picky than they are)

To answer a few of your questions:
1) Yes, they are datasheets. One for a header, one for detail.
2) The OnCurrent and OnActivate events on these datasheets do not fire when resizing. This was not causing the flicker.
3) I cannot convert them to Continuous forms at this time, however, they would probably look better than they do now. They ARE
read only...so I'll consider that for a future release.
4) No resizing over other objects is required. We have a definitive edge where controls will not be affected.

So thank you to everyone that took the time to contribute. Feel free to use, trash, hoard or otherwise distribute this code freely.

J

 

by: harfangPosted on 2009-11-11 at 02:09:55ID: 25793654

I'm glad you got some sort of improvement out of this.
Thanks and success with your project! -- (°v°)

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...