OK, so I made a form in C #. You can take the controller like run-time to a button, you can take it or a picture anyway, I was thinking that anyway you can create an invisible range, so that you control the screen from the program Can not pull out. Like windows you can drag the window out of the screen area. I do not want you to do this, and I wanted to see if you can also do that you can make borders around the edge control so that you can pull them on one another. Any help would be great! Thanks!
Well, I'm using DevExpress DXv2 with WinForms.
Private Zero Group Control2_MouseMove (Object Sender, MouseEventArgs E) {if (e.button == MouseButtons Left) {groupControl2.Left + = eX - move.X; GroupControl2.Top + = e.Y - Transfer. Y; }} Private Zero Group Control2_MouseDown (Object Sender, MouseEventArgs e) {move = e.Location; }
It seems that you are using some kind of control assembly Provides you with the panel to drag and drop.
First check whether there is built-in functionality to go out of the scene window area in the control library. I think this is an event which indicates that the panel has moved. Check this pseudo code:
if (panel.Left <0) {} // outside the left edge (panel top & lt; 0) {} // top border If outside (panel (left + panel width)> form. With}} // outside the right border ((panel top + panel. Height)> form. Height) {} // below either:
If the event is canceled, cancel any of the above if it is true. Otherwise you can apply something like this pseudo code (actual WinForms dimensions require slightly different values)
// outside the left border (panel.Left <0 ) {Panel.Left = 0; } // If out of the top boundary (panel top.lt; 0) {panel.Top = 0; } // If outside the right border ((panel.Left + panel.Width)> form.Width) {panel.Lieft = form.Width - panel.Width; } // If outside the range below ((panel top + panel. Height)> form. Height) {panel.Top = (form.Height - panel.Height); }
Comments
Post a Comment