Click here to Skip to main content
15,890,282 members
Home / Discussions / C#
   

C#

 
AnswerRe: getting system information through C# Pin
Marshall24-Jul-08 10:54
Marshall24-Jul-08 10:54 
AnswerRe: getting system information through C# Pin
led mike24-Jul-08 11:02
led mike24-Jul-08 11:02 
QuestionFileSystemEventHandler arg type Pin
Not Knuth24-Jul-08 9:53
Not Knuth24-Jul-08 9:53 
AnswerRe: FileSystemEventHandler arg type Pin
led mike24-Jul-08 11:12
led mike24-Jul-08 11:12 
GeneralRe: FileSystemEventHandler arg type Pin
Not Knuth24-Jul-08 11:25
Not Knuth24-Jul-08 11:25 
GeneralRe: FileSystemEventHandler arg type Pin
led mike24-Jul-08 11:42
led mike24-Jul-08 11:42 
GeneralRe: FileSystemEventHandler arg type Pin
Not Knuth24-Jul-08 11:46
Not Knuth24-Jul-08 11:46 
QuestionProblem moving Controls at runtime Pin
kbalias24-Jul-08 9:49
kbalias24-Jul-08 9:49 
Hi
I am using Visual Studio 2005 to create a Windows Application. I am struggling to move controls at runtime using the mouse.

I works fine when the Control (panel1) is directly on the Form, but when the Control is on another panel (panelGrid) on the Form it does not work well.

I use the following for the MouseMove event:
private void Control_MouseMove(object sender, MouseEventArgs e)
{
    Control control = (Control)sender;

    if (dragging)
    {
        Point location = new Point(e.X, e.Y);

        location = control.PointToScreen(location);

        location = PointToClient(location);

        location.Offset(dragOffset);

        control.Location = location;
    }
}


When the Control is on another panel and not directly on the Form it jumps when I start moving it with the mouse.

I think it is probably the following lines that needs to change:
location = control.PointToScreen(location);
location = PointToClient(location);


I tried the following but it made it even worse:
location = control.Parent.PointToClient(location);


Can anyone throw some light on this for me please.

Thanks

Kobus
QuestionTrace Statements Pin
#realJSOP24-Jul-08 9:31
mve#realJSOP24-Jul-08 9:31 
AnswerRe: Trace Statements Pin
Wendelius24-Jul-08 9:40
mentorWendelius24-Jul-08 9:40 
AnswerRe: Trace Statements Pin
led mike24-Jul-08 10:53
led mike24-Jul-08 10:53 
QuestionRemove Node in XML file Pin
dataminers24-Jul-08 9:26
dataminers24-Jul-08 9:26 
AnswerRe: Remove Node in XML file Pin
PIEBALDconsult24-Jul-08 10:16
mvePIEBALDconsult24-Jul-08 10:16 
Questiondisplaying a date range in a listview Pin
obievil24-Jul-08 9:08
obievil24-Jul-08 9:08 
AnswerRe: displaying a date range in a listview Pin
Wendelius24-Jul-08 9:27
mentorWendelius24-Jul-08 9:27 
Questionimplementing shortcut keys Pin
ankkit24-Jul-08 8:13
ankkit24-Jul-08 8:13 
AnswerRe: implementing shortcut keys Pin
PIEBALDconsult24-Jul-08 8:27
mvePIEBALDconsult24-Jul-08 8:27 
GeneralRe: implementing shortcut keys Pin
ankkit25-Jul-08 7:08
ankkit25-Jul-08 7:08 
GeneralRe: implementing shortcut keys Pin
PIEBALDconsult25-Jul-08 10:58
mvePIEBALDconsult25-Jul-08 10:58 
QuestionHow to set different color for different items in a list box. (asp.net page, C# backend) Pin
mdpavel24-Jul-08 6:46
mdpavel24-Jul-08 6:46 
AnswerRe: How to set different color for different items in a list box. (asp.net page, C# backend) Pin
Christian Graus24-Jul-08 10:59
protectorChristian Graus24-Jul-08 10:59 
AnswerRe: How to set different color for different items in a list box. (asp.net page, C# backend) Pin
nelsonpaixao24-Jul-08 13:10
nelsonpaixao24-Jul-08 13:10 
QuestionBitwise Circular Shift in C# Pin
Ian Uy24-Jul-08 6:38
Ian Uy24-Jul-08 6:38 
AnswerRe: Bitwise Circular Shift in C# [modified] Pin
User 665824-Jul-08 7:16
User 665824-Jul-08 7:16 
GeneralRe: Bitwise Circular Shift in C# Pin
Ian Uy24-Jul-08 7:26
Ian Uy24-Jul-08 7:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.