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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Kirtan PatelRank #292 · 8.6K reputationPosted Nov 16, 2009, 4:58 AM EST
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);
}
}
none64 reputationPosted Nov 16, 2009, 6:07 AM EST
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
Kirtan PatelRank #292 · 8.6K reputationPosted Nov 16, 2009, 6:21 AM EST
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