btw ... that is very cool. Can I use that?
mx
Main Topics
Browse All TopicsThis 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
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
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.
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.
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.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
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.
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
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.
mx
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
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.
<<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.
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°)
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
Business Accounts
Answer for Membership
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