TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
econobeing
NA
7
0
moving a window without using the title bar?
Jan 25 2005 7:57 PM
i've seen it done before, but i cant seem to do it right. i want to be able to drag the window over the screen while the mouse button is held down on a panel, but when i click on the panel, the whole window moves so that the top right corner is directly under the pointer. i want to be able to move it from where it is, like a title bar, not have it teleport to under my cursor before i move it. so far the moving it part of the code goes like this: private void panel1_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e) { followmouse=true; } private void panel1_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e) { followmouse=false; } private void panel1_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e) { if(followmouse) { // this.DesktopLocation = new Point((e.X - this.Left)+this.Left,(e.Y - this.Top)+this.Top); //this.DesktopLocation = new Point(e.X,e.Y); this.DesktopLocation = Control.MousePosition; } } the commented out parts are the old attempts, and they work worse than my current attempt.
Reply
Answers (
2
)
How to update a table from a DataGrid?
buffer = sr.ReadLine().ToCharArray())!=null