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

Form covers taskbar when maximized

I've noticed that a form will cover the taskbar when it is maximized if its
ControlBox property is set to false (even if the "Keep the taskbar on top of
other windows" option is selected). You can reproduce this by showing the
following form:

Public Class Form1
Inherits Windows.Forms.Form
Public Sub New()
MyBase.New()
Me.ControlBox = False
Me.WindowState = FormWindowState.Maximized
End Sub
End Class

What I want is for the form to behave as it does when ControlBox is set to
true (except that I want the ControlBox to be hidden).

Thanks for any help!
Lance

Feb 6 '07 #1
7 9884
Hi Lance,

I performed a test based on your sample code on both Windows Server 2003
and Vista, but didn't reproduce the problem.

I found that only if the "Keep the taskbar on top of other windows" option
is NOT selected, the form will cover the taskbar.

Could you tell me what the OS is you're using?
Sincerely,
Linda Liu
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

Feb 7 '07 #2
Hi Linda,

Thank you for looking into this. I am using WinXP, SP2.

Lance

Feb 7 '07 #3
Hi Lance,

I have performed another test on Windows XP, but I didn't reproduce the
problem.

I suggest that you perform tests on other machine to see if the problem
still exists. You may also have a try moving the statements of setting
ControlBox and WindowsState property of the form to the form's Load event
handler.

Hope this helps.
Sincerely,
Linda Liu
Microsoft Online Community Support

Feb 9 '07 #4
Try placing a call to InitializeComponent() in your Sub New().

--
Terry
"ljlevend2" wrote:
Hi Linda,

Thank you for looking into this. I am using WinXP, SP2.

Lance
Feb 9 '07 #5
Hi Linda,

I tried my code on two other computers with WinXP, SP2 and they both acted
the same. One thing that I noticed is that the form only covers the taskbar
if its Text property is set to an empty string. If the Form's Text property
is not an empty string then the title bar will be shown which appears to
prevent my issue from occuring. I suspect that this is why Terry's
suggestion of calling InitializeComponent appears to work (because the form's
Text property is set to "Form1").

I also tried setting ControlBox and WindowState in the the Form.Load event
but that did not fix the problem.

When attempting to reproduce the issue make sure that there isn't any
designer code, such as in Form1.Designer.vb. If this file exists, then just
delete it and then verify that Form1.vb only contains my sample code:

Public Class Form1
Inherits Windows.Forms.Form
Public Sub New()
MyBase.New()
Me.ControlBox = False
Me.WindowState = FormWindowState.Maximized
End Sub
End Class

Thanks again for looking into this.
Lance

Feb 9 '07 #6
Hi Lance,

Thank you for pointing out the key point of the problem. I have set the
Text property of the form to an empty string (the ControlBox property to
false and WindowState property to Maximized), and did see that the form
covers the taskbar.

(FYI, I also found that if I set the WindowState property of the form to
Normal, the form has no title bar when it shows up.

I searched our inner database and found a document saying that setting the
Text property to an an empty string and ControlBox property to false is a
good way to get rid of the title bar on a form and this behavior is by
design. )

A workaround of your problem is to set the Text property of the form to a
non empty string in design-time, and then set this property to an empty
string in the form's Load event handler and after the code of setting the
ControlBox and WindowState properties if they are located in the Load event
handler.

The following is a sample.

Public Class Form1
Sub New()
' This call is required by the Windows Form Designer.
InitializeComponent()

' Add any initialization after the InitializeComponent() call.

Me.WindowState = FormWindowState.Maximized
Me.ControlBox = False
End Sub

Private Sub Form1_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load
Me.Text = ""
End Sub
End Class

-or-
Public Class Form1
Private Sub Form1_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load
Me.WindowState = FormWindowState.Maximized
Me.ControlBox = False
Me.Text = ""
End Sub
End Class

Please try my suggestion and let me know the result.
Sincerely,
Linda Liu
Microsoft Online Community Support

Feb 12 '07 #7
You're right, that does it. You've been a big help. Thanks!
Lance

Feb 13 '07 #8

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

Similar topics

1
by: Jon Pope | last post by:
I'm maintaining an internal tool within my organization. Some of my users have resized their system font size by changing the DPI setting from 96DPI to 120DPI (by right-clicking the desktop and...
0
by: Sakharam Phapale | last post by:
Hi All, How to show each instance of child form in Taskbar. In my application I have following forms. frmMain :- MDI Parent frmChild :- MDI Child, Maximize state I want to show only active...
6
by: Gustaf | last post by:
My Windows app is dependant on some registry keys settings. In case the subkey for the app doesn't exists, I want to show a messagebox, and then quit the whole program (without showing the main...
1
by: Banta | last post by:
my form is frezzing when I go loop - how do I fix
2
by: Tom_F | last post by:
To comp.databases.ms-access -- I would like to trigger an event when I close a form -- but ONLY when the data in the "RecordSource" table has been updated. I tried using the AfterUpdate event,...
1
Mague
by: Mague | last post by:
Hello, First of all thanks for trying to help. My problem is in vb.net 2008 (it's pritty much the same as 2005) when a vb program is maximized it just makes the background bigger and everything...
0
by: =?Utf-8?B?QmhhcmF0?= | last post by:
In Vb Net in open crystal Report after opening In open mode i open a form then form is opening in maximized mode (i have disable maximized button in form level) SO give me solution.
3
rizwan6feb
by: rizwan6feb | last post by:
I know the problem but can't find the solution. Please help I have 2 forms in my application (Form1 and Form2, Form1 is the startup form). I am connecting to the database in a new thread (In the...
3
mahboobeh
by: mahboobeh | last post by:
Hi every body I'm tring to handle a mouse click event for the form is minimized to system Task bar(when minimized form in taskbar click). Does any one know how to do that? Thanks
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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
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...

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.