472,986 Members | 2,933 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,986 software developers and data experts.

Flickers

Hi all,

We have a windows forms application with different controls used
inside, each control has several input items such as textboxes , custom
labels, user controls, and some treeviews.. etc.
We have been trying to eliminate flickering issues when loading different
controls or switching to different views with no luck, and have been trying
different suggested methods to get rid of the flickering such as:
- this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
- this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
- SuspendItemsLayout();
- ResumeItemsLayout();
Unfortunately using the above code in each control or the main form
didn't help too, I'm wondering desperately if there is another way to
fix this annoying problem?
FYI: We are using Visual Studio 2005 Team Suite SP2/ .NET 2.0 running on
mainly
Windows XP Professional SP2 on 3.20 GHz multithreaded CPU and 1GB RAM.
Thanks for your help. Regards, greetings

--
http://www.alhambra-eidos.es/web2005/index.html
www.kiquenet.net
http://www.setbb.com/putainformatica...opic.php?p=843
www.trabajobasura.com/solusoft

Aug 1 '08 #1
4 1422
=== original message ===
from: Alhambra Eidos Kiquenet
date: 01.08.2008 09:49
Hi all,

We have a windows forms application with different controls used
inside, each control has several input items such as textboxes , custom
labels, user controls, and some treeviews.. etc.
We have been trying to eliminate flickering issues when loading different
controls or switching to different views with no luck, and have been trying
different suggested methods to get rid of the flickering such as:
- this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
- this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
- SuspendItemsLayout();
- ResumeItemsLayout();
Unfortunately using the above code in each control or the main form
didn't help too, I'm wondering desperately if there is another way to
fix this annoying problem?
Did you try the simple 'DoubleBuffer = true;'

Cheers,
Udo
Aug 1 '08 #2
On Aug 1, 11:49*am, Alhambra Eidos Kiquenet
<AlhambraEidosKique...@discussions.microsoft.comwr ote:
*Hi all,

We have a windows forms application with different controls used
inside, each control has several input items such as textboxes , custom
labels, user controls, and some treeviews.. etc.

We have been trying to eliminate flickering issues when loading different
controls or switching to different views with no luck, and have been trying
different suggested methods to get rid of the flickering such as:
- this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
- this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
- SuspendItemsLayout();
- ResumeItemsLayout();

Unfortunately using the above code in each control or the main form
didn't help too, I'm wondering desperately if there is another way to
fix this annoying problem?
One dangerous trick is to use P/Invoke to send WM_SETREDRAW message to
enable/disable redrawing for a specific control. You disable redrawing
before a batch of updates, and enable them once you're done. Something
like this:

internal const int WM_SETREDRAW = 0x000B;

[DllImport("user32", CharSet = CharSet.Auto)]
internal static extern IntPtr SendMessage(IntPtr hWnd, int
msg, int wParam, IntPtr lParam);

void UpdatingMethod()
{
try
{
SendMessage(control.Handle, Win32.WM_SETREDRAW, 0,
IntPtr.Zero);
// Perform your updates here
...
}
finally
{
SendMessage(control.Handle, Win32.WM_SETREDRAW, 1,
IntPtr.Zero);
}
}

Aug 1 '08 #3
What about window form designer code ?? This code has method like
SuspendLayout and others , how can I do updates of control with my custom
control ?

any sample, please ?

Thanks.
Aug 1 '08 #4
On Aug 1, 5:01*pm, Alhambra Eidos Kiquenet
<AlhambraEidosKique...@discussions.microsoft.comwr ote:
What about window form designer code ??
What about it? Flicker typically occurs when you're updating a large
number of controls on the form; whether they were created in the
designer or by hand is entirely irrelevant. You can get the handle of
the entire form, or of a specific panel with controls, by using its
Handle property; and then just do the trick I've described above.
any sample, please ?
Since we have no idea what exactly you're doing that's causing the
flicker - since you haven't posted any code - there isn't much that
can be added.

Aug 1 '08 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: vanisathish | last post by:
Hi I am running a client side javascript timer to periodically refresh the contents of some tables in the HTML page. The table values are dynmically binded from XML DOM object using the <XML tag...
0
by: Sakharam Phapale | last post by:
Hi All, When I runs following code RichTextBox control on form flickers. I don't know why it's so? Is any idea to avoid flickering? private void cmdBold_Click(object sender, System.EventArgs...
8
by: nirdeshonline | last post by:
Hi, I have added a simple listbox in windows form under c# 2.0. It contains a collection of approx 10 strings as list items. Now when i resize the form whole listbox flickers. Please tell me...
0
by: nirdeshonline | last post by:
Hi, I have added a tabcontrol in windows form under c# 2.0 and docked it to FILL.then i kept a listbox on this docked tabcontrol .Listbox contains a collection of approx 10 strings as list items....
4
by: jobs | last post by:
the javascript: function ShowTooltip(L1in) { document.getElementById("L1").innerText=L1in; y = event.clientY + document.documentElement.scrollTop; var Popup= document.getElementById("Popup")...
1
by: Tom | last post by:
Hey, Probably not the best idea, but i'm trying to draw into a D3D app (3d Modelling Program), to show what is going on with processor / hdd activity / and teamspeak), but i am having some...
0
by: pianobasher | last post by:
Hello I have a class that's derived from a normal windows Form. I call it BaseContainer. It has a Panel and a built-in method to add another BaseContainer derivative inside that panel. I hoped...
3
by: Spizzat2 | last post by:
I've got some javascript that will show or hide an element on the page when a user activates it. The problem I'm having is that the content changes the length of the page, so if the user scrolls to...
1
by: Axel Gallus | last post by:
I add some option items to a <selectbox by: ----- MySelect.length = null; // clears all options in select element for ( var i in Somename ) { MySelect.options = new Option(Somename,
2
by: sangam56 | last post by:
Hi all. I have used modalpopup extender to popup a login from a panel. It is shown when a timer in the masterpage fires it's tick event. Everything is going ok. But each item a child page loaded the...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
4
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.