473,396 Members | 1,858 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,396 software developers and data experts.

How to avoid flicker while adding controls to a Panel

Hi,

I would like to know how to avoid flicker while adding controls to a
panel. I couldn´t find any kind of "BeginUpdate/EndUpdate" on it.

Thanks in advance

Alessandro
Nov 17 '05 #1
1 10981
You can use SuspendLayout() and ResumeLayout().

Also, try inheriting Panel and creating a custom class. Set the class style to use DoubleBuffering. It reduces flicker.

public class MyPanel : System.Windows.Forms.Panel
{
public MyPanel()
{
SetStyle(System.Windows.Forms.ControlStyles.Double Buffer, true);
SetStyle(System.Windows.Forms.ControlStyles.AllPai ntingInWmPaint, true);
SetStyle(System.Windows.Forms.ControlStyles.UserPa int, true);
}
}

--
Dave Sexton
dave@www..jwaonline..com
-----------------------------------------------------------------------
"Alessandro Fragnani" <al*********@gmail.com> wrote in message news:%2****************@tk2msftngp13.phx.gbl...
Hi,

I would like to know how to avoid flicker while adding controls to a panel. I couldn´t find any kind of "BeginUpdate/EndUpdate" on
it.

Thanks in advance

Alessandro

Nov 17 '05 #2

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

Similar topics

2
by: Big D | last post by:
Hi all, I'm having a problem adding controls to a panel dynamically. I have a usercontrol that I create and try to add 5 times to the panel, but I only ever see the first control. I know it's...
2
by: avivgur | last post by:
Hello, I am writing a program in Visual C# and I have encountered a problem. In my program I want to dynamically create a multitude of controls (thousands) on a form. The problem is that calling...
4
by: Marco Segurini | last post by:
Hi, I am trying to avoid flicker in this situation: 1) I create a simple VB6 Window application (a void form) and I define this code for the form (that has the autoredraw property set to...
5
by: Jeremy Ames | last post by:
I have run into a major road block with my page development projects. I am trying to add a literal control to my asp.net page and I got an error stating that the control could not be added because...
3
by: Ankit Aneja | last post by:
I have a strange situation and I have no idea how to solve this. Its a Recruitment Search Page,in the Admin Page, for every button click event the Admin Person has to create a checkbox on the users...
2
by: Oleg Ogurok | last post by:
Hi all, Does anyone have example of adding controls on the client side (DHTML) and then persisting them as ASP.NET server controls on the server side? For example, a page has an <input>...
0
by: spikedpunchvictim | last post by:
Maybe someone here can help me. I am programatically adding Controls to a Panel whose AutoScroll Property is set to True. When I add more controls than can visually fit on the Panel, they just...
3
by: Mark Denardo | last post by:
I'm trying to dynamically create and add controls to a web page: Label obj1 = new Label(); DropDownList obj2 = new DropDownList(); Controls.Add(obj1); Controls.Add(obj2); But I get the...
4
by: Lewis Holmes | last post by:
Hi I have the following situation in one of my asp.net pages. The user can add multiple table rows to a form by selecting a button. These rows can contain asp.net controls. When this button is...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.