How to drag a form without the caption bar 
Author Message
 How to drag a form without the caption bar

My C# application has no Caption-bar (by design).
How can i let the user move the form, without using the Caption-bar?

I think something like:

this.MouseDown += new
System.Windows.Forms.MouseEventHandler(this.Form_MouseDown);

...

private void Form_MouseDown(object sender, MouseEventArgs e){

if (System.Windows.Forms.MouseButtons.Left == e.Button){

???

Quote:
}
}

But how do i set the position of the active form?


Sat, 14 Feb 2004 01:14:18 GMT  
 How to drag a form without the caption bar
Not sure if this is what you want, but to move the form you can try:

    this.SetBounds(x,y,width,height);

it will move your from as well change the size if you want...... just a
suggestion.


Quote:
> My c# application has no Caption-bar (by design).
> How can i let the user move the form, without using the Caption-bar?

> I think something like:

> this.MouseDown += new
> System.Windows.Forms.MouseEventHandler(this.Form_MouseDown);

> ...

> private void Form_MouseDown(object sender, MouseEventArgs e){

> if (System.Windows.Forms.MouseButtons.Left == e.Button){

> ???

> }

> }

> But how do i set the position of the active form?



Sat, 14 Feb 2004 04:42:48 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. How to drag a form without caption answer.

2. Window without caption bar

3. How to implement a Property Sheet without caption bar

4. Creating A Window Without A Caption Bar.....

5. MFC without Caption bar

6. How to implement a Property Sheet without caption bar

7. Windows forms caption bar

8. HowTo?: Drag a form without bouncing controls

9. Window Without border and without title bar

10. Getting window handle without matching window caption text

11. Moving windows without visible caption

12. SDI As Child without Caption but with Menu

 

 
Powered by phpBB® Forum Software