location of the Dialog form

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • akshaycjoshi
    New Member
    • Jan 2007
    • 153

    location of the Dialog form

    See the two pics below.
    The form should have it's top-left corner to the end of the node that is clicked,even if i move the main form.
    How would i set the location property of the newly showed form ?

    Here is the code in which tsmiaddextensio n is the ToolStripMenuIt em which is clicked.

    private void tsmiaddextensio n_Click(object sender, EventArgs e)
    {
    string selnodetext = treeexchange.Se lectedNode.Text ;
    AddExtensionDia log aed = new AddExtensionDia log(treeexchang e.SelectedNode. Text);
    aed.Location = new Point(treeexcha nge.Right/2, treeexchange.To p*5);
    this.Text = aed.Location.To String();
    if (aed.ShowDialog () == DialogResult.OK )
    {
    refreshtree();
    foreach(TreeNod e tn in treeexchange.No des[0].Nodes)
    if(tn.Text==sel nodetext)
    tn.Expand();
    }
    }





  • Plater
    Recognized Expert Expert
    • Apr 2007
    • 7872

    #2
    Could you use the PointToScreen function?

    Comment

    • akshaycjoshi
      New Member
      • Jan 2007
      • 153

      #3
      Yes Plater, I did it and it's ok now.
      Ty.

      Comment

      Working...