title bar

  • Thread starter Thread starter cal
  • Start date Start date
Hi Carlos,

You can remove the WS_CAPTION window style from the Form1 to get what you
want. To do this, override the CreateParams property of the Form1 and
remove the WS_CAPTION window style from the original window style.

The following is a sample:

public partial class Form1 : Form
{
int WS_CAPTION = 0xc00000;
protected override CreateParams CreateParams
{
get
{
CreateParams cp = base.CreateParams;
cp.Style &= ~WS_CAPTION;
return cp;
}
}
}

Run the application and you should see the Form1 has no caption now but a
thick border, so you can still resize the Form1 by dragging the form
borders using the mouse.

Hope this helps.
If you have any question, please feel free to let me know.

Sincerely,
Linda Liu
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.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/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
Hi Carlos,

How about the problem now?

If you have any question, please feel free to let me know.

Thank you for using our MSDN Managed Newsgroup Support Service!

Sincerely,
Linda Liu
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

This posting is provided "AS IS" with no warranties, and confers no rights.
 
Hi Linda, thanks very much for your replays wich I shall see later, but for
me your replay seems very good, because Scotts way doesnt permit me to move
the form, so your way it seems I shall have no need to modify any Mouse
events. Sorry Im not a professional developer, so I have to read about
properties, etc. Final comment, it seemed to me good to know the answer to
this question, because to create a new Control/UserControl should have
important diferences, and for me it wasnt any easy to guess that Border
should have something to do with the titlebar, so, Scott, thanks to you
too!.

Carlos.
 
Hi Carlos,

I am reviewing this post in the newsgroup and would like to know the status
of this issue.

If you have any question, please feel free to let me know.

Thank you for using our MSDN Managed Newsgroup Support Service!

Sincerely,
Linda Liu
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

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

I ve just tested your solution,
the form can be resized but cant be translated, I know how to implement
MouseDown, MouseMoveEvents to translate the form, and similar things,
but I suppose it could be interesting if the form could be translated by
other
simpler ways.

best regards, Carlos.
 
Hi Carlos,

Thank you for your reply!
the form can be resized but cant be translated,

By "can't be translated", do you mean the form can not be moved? If so,
you're right. Only when a form has a caption, we can move the form by
dragging the form's caption with Mouse.

As you have mentioned, the workaround is to handle the MouseDown and
MouseMove event of the form. IMO, there's no simpler way to do it.

Hope this helps.
If you have any other question, please feel free to let me know.

Sincerely,
Linda Liu
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

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

Please one more doubt, Im not professional developer
what means in your code

cp.Style &= ~WS_CAPTION;

wich I undestand as being something like

cp.Style = ~WS_CAPTION & cp.Style ;

wich I cant understand either.
Ok, thanks very much for all Linda, best regards, Carlos.
 
Hi Carlos,

Thank you for your reply!

Yes, you're right. The line of code "cp.Style &= ~WS_CAPTION;" equals to
"cp.Style = ~WS_CAPTION & cp.Style ;"

The CreateParams.Style property gets or sets a bitwise combination of
window style values. With the above line of code, we remove the WS_CAPTION
style from the original windows style values to remove the caption from the
Form.

For more information about CreateParams class, please refer to the
following MSDN document:
http://msdn.microsoft.com/en-us/library/system.windows.forms.createparams.as
px

If you have anything unclear, please feel free to let me know.

Sincerely,
Linda Liu
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

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

I am reviewing this post in the newsgroup and would like to know the status
of this issue.

If you have any question, please feel free to let me know.

Thank you for using our MSDN Managed Newsgroup Support Service!

Sincerely,
Linda Liu
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

This posting is provided "AS IS" with no warranties, and confers no rights.
 
thanks Linda for all, I liked your answers very much, since I have to worry
only to move the mouse
and not to resize it.

Some final comment for basic-intermediate csharp users like me,
I concluded cp.Style is a binary number, so you can operate it with & ||
commands,
with other binary numbers, obtaining the desired Form´s style, I suppose I
must verify
this by my own. I have no more problems by now, since I know how
to implement the methods to move the form.

greetings, Carlos.
 
Hi Carlos,

Thank you for your response!

I am glad to hear that the problem is solved now. It's my pleasure to work
with you.

If you have any other questions in the future, please don't hesitate to
contact us. It's always our pleasure to be of assistance!

Have a nice day!

Sincerely,
Linda Liu
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

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