473,320 Members | 1,920 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 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 1436
=== 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: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.