call WM_NCCALCSIZE
Everything it`s fine with it... but... when i press o key... i must to change client area. my WM_NCCALCSIZE methode it`s enter but still no change in my form...
How cand i resize Client Area when i press a button?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Kirtan PatelPosted Nov 16, 2009, 9:58 AM
Here is Code to Perform What you wanted
private void Form1_Load(object sender, EventArgs e)
{
this.KeyPreview = true;
}
private void Form1_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == (char)Keys.O || e.KeyChar == 'o')
{
this.ClientSize = new Size(this.ClientSize.Width + 10, this.ClientSize.Height + 10);
}
}
Kirtan PatelPosted Nov 16, 2009, 11:21 AM
Here is Code How to Add Button in NonClient Area
Download Sample Project
Useful Article for you
http://www.codeproject.com/KB/vista/takecontroloftitlebar.aspx
Credits to Original Author of the Example
http://www.thecodeking.co.uk/2007/09/adding-caption-buttons-to-non-client.html
nonePosted Nov 16, 2009, 11:07 AM
another question... it`s there a easy way to add a button to nonclient area?
it`s not what i want... but it`s working...
another question... it`s there a easy way to add a button to nonclient area?
To add it... i must to:
- draw the button
- call testhit to see when i on over the botton
- override mouseclick or get event
- etc etc...
or there is something like:
nonclientArea.Controls.Add(this.mybutton);
thanks