|
when the user clicks on the form. the form is in an mdi app
|
|
|
|
|
Once again just to confirm, have u tried like this:
Also note what Alex has mentioned: You can not pick the point outside the Form.
private void Form1_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e)
{
this.Location = PointToScreen(new Point(e.X, e.Y));
}
|
|
|
|
|
it still seems to offset the dialog like an inch below and to the right
|
|
|
|
|
It does not occur in my demo application. Please re-check and revert back.
|
|
|
|
|
this is the code i have
<br />
private void EditEmp_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)<br />
{<br />
dragging = true;<br />
this.Dock = System.Windows.Forms.DockStyle.None;<br />
this.Location = PointToScreen(new Point(e.X, e.Y));<br />
}<br />
>/code><br />
<br />
and it doesnt move the dialog to where my mouse is
|
|
|
|
|
Do u want to drag the form using mouse in run-time, the way u do while holding title bar of the form?? Be very clear please...
|
|
|
|
|
yes i already am able to make the form move via the mouse move event and im using the same location logic and it still follows at a distance.. i think i may know why its doing this tho but i dont know the solution when the user click the form its using the forms mouse positon and not the parents how can i get the parents coordinates for the mouse when i click in a child form?
|
|
|
|
|
You would have told me before...I simply wasted my time. I know there will be offset in this logic, if u want to drag the form.
in mean time, try solving it at yr end.
I will try to work out and post the solution probably tomorrow......
|
|
|
|
|
Im not going to give you a code solution. Here is how you do it (psuedo-code straight from my head, hopefully no mistakes):
Point originalFormLocation;
Point originalMouseDownLocation;
bool state;
onMouseDown()
{
state = moving;
}
onMouseMove()
{
if (state = moving)
{
}
}
onMouseUp()
{
}
Note: you're always working with screen coordinates.
This posting is provided "AS IS" with no warranties, and confers no rights.
Alex Korchemniy
|
|
|
|
|
Yes..Alex...This will work perfect. I had implemented the same in my previous project. Only little bit of correction is required...You do not need to save the form's location in MouseDown (If I remember correctly..).
|
|
|
|
|
OK As long as you can get it to work.
I believe saving the original coordinate at begining is necessary to get error free moving. If you're not moving relative to the point where you start but you're doing something relative to the last time the mouse was moved you can get some big glitches.
This posting is provided "AS IS" with no warranties, and confers no rights.
Alex Korchemniy
|
|
|
|
|
Actually Previous MouseDown Location's coordinate is relative the the previous Form location,
And If you see with reference to the screen , The mouse down location saving should solve the purpose....
I will try to post the code tomorrow...
|
|
|
|
|
I've searched all over and haven't been able to find much help with burning data CDs in C#. I saw one article that used IMAPI Wrapper, but it was originally written in VB and I haven't been able to get even their source code C# version to compile properly.
Any help?
17 years old with too much free time.
...cooler than the other side of the pillow.
|
|
|
|
|
Have you taken a look at the IMAPI wrapper by Steve McMahon? IMAPI_Wrapper[^]
This posting is provided "AS IS" with no warranties, and confers no rights.
Alex Korchemniy
|
|
|
|
|
Yes, but I haven't been able to get it working, something about the reference to the .dll is wrong. I'll edit this post with greater details later tonight when I get off work.
17 years old with too much free time.
...cooler than the other side of the pillow.
|
|
|
|
|
I've tested the latest code with Visual Studio .net 2003. You just have to take out the lines for assembly signing.
This posting is provided "AS IS" with no warranties, and confers no rights.
Alex Korchemniy
|
|
|
|
|
hi there ,
in my Form i have 40 textbox filds
i want to ensure that all of them has data inside
all of the filds must have a valid values inside
how can do a loop that cahek all of the filds in my Form in one click ?
maybe somene have an sample
thanks alloot
|
|
|
|
|
|
Hi,
I create a custom control derived from an textbox.
<br />
...<br />
public class JButton : System.Windows.Forms.Button {<br />
...<br />
Then I create a form, frmBase, and I put my new button on it.
After that I create a form, frmInherited, that inherits from my frmBase.
When I run it my custom control isn't visible.
But when I put a normal Button on frmBase and I recompile and run it again I can see the normal button. But never the custom button.
Can anyone help? I can provide the full code if needed.
thx
Jochen
|
|
|
|
|
Do you have a designer class for the button? Have you associated the designer with your button? If not: search a little to see how its done.
This posting is provided "AS IS" with no warranties, and confers no rights.
Alex Korchemniy
|
|
|
|
|
My code is a bit like this: Writing your Custom Control: step by step
And the button is visible when I use only frmBase. Compile and run frmInherited that inherits from frmBase. I can't see the button I placed on frmBase.
I will try the designer. But in my opinion a designer is only needed when I want to see the control in VS.NET.
My problem is that I can't see it when I compile and run.
Jochen
|
|
|
|
|
I'm sorry I missed what you said about runtime.
I would use the debug to step through the code and try to find the bug. I have no ideas.
This posting is provided "AS IS" with no warranties, and confers no rights.
Alex Korchemniy
|
|
|
|
|
Where can I find WMI Programming????
Jijo kuruvila
software developer
trivandrum
|
|
|
|
|
|
Hello all,
I need to search through a pile of source code and pick out certain "help IDs" based on context and output them to a file, GUI, etc. Now, I can think of many many ways to do this, but what I want to know his, what is the BEST way to do this in your opinion?
I could make my program read through every line of every file and use String.substring; I could use Regex.Match on every line, I could use Regex.Match on entire files dumped into strings, etc. I would like to use a regex, but I'm basically not sure if it is more efficient to do it line-by-line or file-by-file?
I actually started looking at perl to do this but that meant figuring out how scope/namespaces work with recursion in yet another language so...
Thanks for any help.
|
|
|
|