473,407 Members | 2,314 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,407 software developers and data experts.

System.Windows.Forms sizing grip problem

When I resize my window, the sizing grip from the status bar doesn't
dissapear. The funny thing is that if i create a graphics object and dispose
it before the creation of the status bar everything works fine.

Maybe someone can help me with this problem. Thanks!

Here's my StatusBar initialization routine

void InitStatusBar()
{
Graphics g = CreateGraphics(); // If i do this
g.Dispose(); // it works

sb = new StatusBar();
sb.Parent = this;
sb.ShowPanels = true;

// Help panel
sb.Panels.Add("Help");
sb.Panels[0].AutoSize = StatusBarPanelAutoSize.Spring;
sb.Panels[0].Alignment = HorizontalAlignment.Left;

// Date panel
sb.Panels.Add(DateTime.Now.ToShortDateString());
sb.Panels[1].AutoSize = StatusBarPanelAutoSize.Contents;
sb.Panels[1].Alignment = HorizontalAlignment.Center;

// Time panel
sb.Panels.Add(DateTime.Now.ToShortTimeString());
sb.Panels[2].AutoSize = StatusBarPanelAutoSize.Contents;
sb.Panels[2].Alignment = HorizontalAlignment.Center;
}
Nov 15 '05 #1
1 2347
Hello Andrei Zinca

can u give me ur code in detail

bye
pronojit

"Andrei Zinca" <zi****@xnet.ro> wrote in message
news:OT*************@TK2MSFTNGP12.phx.gbl...
When I resize my window, the sizing grip from the status bar doesn't
dissapear. The funny thing is that if i create a graphics object and dispose it before the creation of the status bar everything works fine.

Maybe someone can help me with this problem. Thanks!

Here's my StatusBar initialization routine

void InitStatusBar()
{
Graphics g = CreateGraphics(); // If i do this
g.Dispose(); // it works

sb = new StatusBar();
sb.Parent = this;
sb.ShowPanels = true;

// Help panel
sb.Panels.Add("Help");
sb.Panels[0].AutoSize = StatusBarPanelAutoSize.Spring;
sb.Panels[0].Alignment = HorizontalAlignment.Left;

// Date panel
sb.Panels.Add(DateTime.Now.ToShortDateString());
sb.Panels[1].AutoSize = StatusBarPanelAutoSize.Contents;
sb.Panels[1].Alignment = HorizontalAlignment.Center;

// Time panel
sb.Panels.Add(DateTime.Now.ToShortTimeString());
sb.Panels[2].AutoSize = StatusBarPanelAutoSize.Contents;
sb.Panels[2].Alignment = HorizontalAlignment.Center;
}

Nov 15 '05 #2

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

Similar topics

0
by: Umesh | last post by:
Hi, I have 2 Forms. One is a MDI Child form, and one is a normal form. Both these forms are displayed on different events on the Main MDI Form. I have set SizeGripStyle = Show for both these...
19
by: Lauren Quantrell | last post by:
In Windows XP display Properties/Appearance users can chose between: Windows XP Style or Windows Classic Style. Is there a way in VBA to determine the user's selection? The reason: Toolbars...
2
by: Tyler Foreman | last post by:
Hello, I had an earlier post regarding a strange exception I (thought) I was getting in my windows form. I have since been able to trace the problem to a picturebox control on my form. I can...
7
by: What-a-Tool | last post by:
I have an mdichild form whose minimum size I want to limit (can't be dragged below a certain size) Even though I am running .NET 1.1 where the minimum size property supposedly works, it's not...
2
by: Graeme Neath | last post by:
I'm having a very bizarre problem. I have a vb.net application which uses the ESRI MapObjects 2.2 component (unmanaged code). When I use the MapObjects built-in function 'CopyMap' to copy the map...
1
by: tassieboy | last post by:
Hi All I have a VB.NET application which runs on all client machines except one, where on startup, it gives the message system.enterpriseservices.thunk.dll, or one of its dependencies, were not...
4
by: Liverpool fan | last post by:
I have a windows application written using VB .NET that encompasses a countdown timer modal dialog. The timer is a System.Timers.Timer with an interval of 1 second. AutoReset is not set so accepts...
1
by: mfunkmann | last post by:
Hi, I recently got an error and I don't know how to fix it: Error 1 'System.Data.DataColumn' does not contain a definition for 'Windows' C:\c#\CsharpPRO\Form1.Designer.cs 304 77 CsharpPRO I...
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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.