Click here to Skip to main content
15,908,675 members
Home / Discussions / C#
   

C#

 
GeneralRe: Unable to Build Release Version of Program Pin
mprice2148-Jun-10 3:51
mprice2148-Jun-10 3:51 
QuestionHow to use DataBinding/DataSets to INSERT both a row in a parent table, and its CHILD table rows (matched by key) at the same time (or right after) Pin
Draekz7-Jun-10 8:49
Draekz7-Jun-10 8:49 
AnswerRe: How to use DataBinding/DataSets to INSERT both a row in a parent table, and its CHILD table rows (matched by key) at the same time (or right after) Pin
Mycroft Holmes7-Jun-10 19:15
professionalMycroft Holmes7-Jun-10 19:15 
GeneralRe: How to use DataBinding/DataSets to INSERT both a row in a parent table, and its CHILD table rows (matched by key) at the same time (or right after) Pin
Draekz8-Jun-10 4:12
Draekz8-Jun-10 4:12 
QuestionMouseLeave event triggered on the wrong window Pin
martingeorgiev7-Jun-10 8:43
martingeorgiev7-Jun-10 8:43 
AnswerRe: MouseLeave event triggered on the wrong window Pin
Andrew Rissing7-Jun-10 8:53
Andrew Rissing7-Jun-10 8:53 
GeneralRe: MouseLeave event triggered on the wrong window Pin
martingeorgiev7-Jun-10 8:57
martingeorgiev7-Jun-10 8:57 
GeneralRe: MouseLeave event triggered on the wrong window Pin
Andrew Rissing7-Jun-10 9:06
Andrew Rissing7-Jun-10 9:06 
It sounded kind of interesting that you couldn't get that to work, so I tried it out. It works using MouseLeave and Capture.

Try the following:

C#
public partial class Form1 : Form
{
    public Form1()
    {
        InitializeComponent();
    }

    private void button1_Click(object sender, EventArgs e)
    {
        using (Form f = new Form())
        {
            f.Capture = true;
            f.MouseLeave += new EventHandler(f_MouseLeave);
            f.Location = new Point(Control.MousePosition.X - 50, Control.MousePosition.Y - 50);

            f.ShowDialog(this);
        }
    }

    private void f_MouseLeave(object sender, EventArgs e)
    {
        MessageBox.Show("Left child.");

        ((Form)sender).Close();
    }
}

Btw, the mouse position is in screen coordinates, so you should convert it if you're wanting to see if its still within the child form (if you had gone that route).

C#
Point pointRelativeToForm = f.PointToClient(Control.MousePosition);

GeneralRe: MouseLeave event triggered on the wrong window Pin
Andrew Rissing7-Jun-10 9:17
Andrew Rissing7-Jun-10 9:17 
GeneralRe: MouseLeave event triggered on the wrong window Pin
martingeorgiev7-Jun-10 9:20
martingeorgiev7-Jun-10 9:20 
QuestionRIP BASED SOFTWARE ROUTER FOR WINDOWS using C# Pin
Member 32734627-Jun-10 7:29
Member 32734627-Jun-10 7:29 
Questionusing and close Pin
imbiz7-Jun-10 7:16
imbiz7-Jun-10 7:16 
AnswerRe: using and close Pin
Keith Barrow7-Jun-10 7:23
professionalKeith Barrow7-Jun-10 7:23 
GeneralRe: using and close Pin
imbiz7-Jun-10 9:20
imbiz7-Jun-10 9:20 
GeneralRe: using and close Pin
Chris Trelawny-Ross7-Jun-10 14:01
Chris Trelawny-Ross7-Jun-10 14:01 
GeneralRe: using and close Pin
imbiz7-Jun-10 14:46
imbiz7-Jun-10 14:46 
GeneralRe: using and close Pin
harold aptroot7-Jun-10 9:51
harold aptroot7-Jun-10 9:51 
AnswerRe: using and close Pin
harold aptroot7-Jun-10 7:25
harold aptroot7-Jun-10 7:25 
GeneralRe: using and close Pin
imbiz7-Jun-10 8:37
imbiz7-Jun-10 8:37 
AnswerRe: using and close Pin
PIEBALDconsult7-Jun-10 13:49
mvePIEBALDconsult7-Jun-10 13:49 
GeneralRe: using and close Pin
imbiz7-Jun-10 14:47
imbiz7-Jun-10 14:47 
AnswerRe: using and close Pin
prasadbuddhika7-Jun-10 18:35
prasadbuddhika7-Jun-10 18:35 
GeneralRe: using and close Pin
imbiz8-Jun-10 1:09
imbiz8-Jun-10 1:09 
Questiontext to speech problem Pin
maryamtooty7-Jun-10 6:08
maryamtooty7-Jun-10 6:08 
AnswerRe: text to speech problem Pin
Anshul R8-Jun-10 20:30
Anshul R8-Jun-10 20:30 

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.