473,652 Members | 3,059 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 = StatusBarPanelA utoSize.Spring;
sb.Panels[0].Alignment = HorizontalAlign ment.Left;

// Date panel
sb.Panels.Add(D ateTime.Now.ToS hortDateString( ));
sb.Panels[1].AutoSize = StatusBarPanelA utoSize.Content s;
sb.Panels[1].Alignment = HorizontalAlign ment.Center;

// Time panel
sb.Panels.Add(D ateTime.Now.ToS hortTimeString( ));
sb.Panels[2].AutoSize = StatusBarPanelA utoSize.Content s;
sb.Panels[2].Alignment = HorizontalAlign ment.Center;
}
Nov 15 '05 #1
1 2353
Hello Andrei Zinca

can u give me ur code in detail

bye
pronojit

"Andrei Zinca" <zi****@xnet.ro > wrote in message
news:OT******** *****@TK2MSFTNG P12.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 = StatusBarPanelA utoSize.Spring;
sb.Panels[0].Alignment = HorizontalAlign ment.Left;

// Date panel
sb.Panels.Add(D ateTime.Now.ToS hortDateString( ));
sb.Panels[1].AutoSize = StatusBarPanelA utoSize.Content s;
sb.Panels[1].Alignment = HorizontalAlign ment.Center;

// Time panel
sb.Panels.Add(D ateTime.Now.ToS hortTimeString( ));
sb.Panels[2].AutoSize = StatusBarPanelA utoSize.Content s;
sb.Panels[2].Alignment = HorizontalAlign ment.Center;
}

Nov 15 '05 #2

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

Similar topics

0
2399
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 forms. However, only the Non-MDI Form displays as well as functions for a sizing grip. The MDI Child form displays the sizing grip, but it does not seem to work. The user has to go to the border for actually sizing the form. Properties of Both...
19
5995
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 size taller in XP than in Classic so I need to size all those nifty windows sizing commands depending on the user's preference.
2
5954
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 reproduce the exception consistently, but it seems to be timing dependent. Here is what happens: I have a subform that I open, load an image from a file into my PictureBox, take some user input, then I hide the
7
1373
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 working for my child forms. Herfried K. Wagner directed me to a code sample which he wrote as a work around for this problem. Very interesting code. You're obviously light years ahead of me in programing skills. Some day in the near future I plan...
2
2348
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 to the clipboard my app will crash sometimes. Even stranger, sometimes if I copy the map to the clipboard (and my app doesnt crash immediately), if I then launch Word my app will spontaneously crash! The CopyMap function takes a parameter...
1
1574
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 found I do not have a reference to this file, and I do not use enterprise services anywhere in the solution.
4
11110
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 the default of True. The Elapsed event handler updates the dialog box with how long before it will close, acting as a timer itself. The dialog has a time to close property which is checked every time the Elapsed event fires. The problem I have...
1
7832
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 am note sure what to do because all propertiers work, except the System.Data.DataColumn.. I didn't write any code by hand and used the visual studio to set the properties..
0
8279
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8467
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8589
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7302
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6160
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4291
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2703
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1914
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1591
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.