Error
-
There are error to compile this code because panel3.left and panel3.top are not defined in the class. How to overcome this? protected override void OnMouseMove(MouseEventArgs e) { base.OnMouseMove (e); if (isDragging3 == true) { panel3.Left = e.X + panel3.Left - x3; panel3.Top = e.Y + panel3.Top - y3; } }
-
There are error to compile this code because panel3.left and panel3.top are not defined in the class. How to overcome this? protected override void OnMouseMove(MouseEventArgs e) { base.OnMouseMove (e); if (isDragging3 == true) { panel3.Left = e.X + panel3.Left - x3; panel3.Top = e.Y + panel3.Top - y3; } }
What is panel3, if it's a control of any type, then it would have those properties.
Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
-
What is panel3, if it's a control of any type, then it would have those properties.
Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
Actually it has that control but it need to be declared. But when i made it into class, but in class it can't be done.
-
Actually it has that control but it need to be declared. But when i made it into class, but in class it can't be done.
OK, so the control does not exist ? You didn't say that. In the properties window of the designer, make sure the GenerateMember property is true. And, choose a better name for it.
Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
-
There are error to compile this code because panel3.left and panel3.top are not defined in the class. How to overcome this? protected override void OnMouseMove(MouseEventArgs e) { base.OnMouseMove (e); if (isDragging3 == true) { panel3.Left = e.X + panel3.Left - x3; panel3.Top = e.Y + panel3.Top - y3; } }
The problem is that you have abstracted the class from the control, and you have control specific code: you should use protect override void OnmouseMouseMove(System.Object sender, System.Windows.Forms.MouseEventArgs e) then you should be able to access the left and top property's through the sender object
-
The problem is that you have abstracted the class from the control, and you have control specific code: you should use protect override void OnmouseMouseMove(System.Object sender, System.Windows.Forms.MouseEventArgs e) then you should be able to access the left and top property's through the sender object
How to access the left and top property's through the sender object? Can you give example. i am new to c# and need guide..
-
How to access the left and top property's through the sender object? Can you give example. i am new to c# and need guide..
Sounds to me like you need to learn some C# before you try to write whatever it is you are trying to write. If you handle an event for a control, within your main class, then you have two incoming variables, like this protected void OnPaneResize(object sender, EventArgs ea) { } You can then do this: protected void OnPaneResize(object sender, EventArgs ea) { Control c = sender as Control; if (c != null) { c.Left = 5; // or whatever } }
Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )