By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,197 Members | 1,205 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,197 IT Pros & Developers. It's quick & easy.

location of the Dialog form

100+
P: 153
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 tsmiaddextension is the ToolStripMenuItem which is clicked.

private void tsmiaddextension_Click(object sender, EventArgs e)
{
string selnodetext = treeexchange.SelectedNode.Text;
AddExtensionDialog aed = new AddExtensionDialog(treeexchange.SelectedNode.Text) ;
aed.Location = new Point(treeexchange.Right/2, treeexchange.Top*5);
this.Text = aed.Location.ToString();
if (aed.ShowDialog() == DialogResult.OK)
{
refreshtree();
foreach(TreeNode tn in treeexchange.Nodes[0].Nodes)
if(tn.Text==selnodetext)
tn.Expand();
}
}





Jan 6 '09 #1
Share this Question
Share on Google+
2 Replies


Plater
Expert 5K+
P: 7,872
Could you use the PointToScreen function?
Jan 13 '09 #2

100+
P: 153
Yes Plater, I did it and it's ok now.
Ty.
Jan 14 '09 #3

Post your reply

Sign in to post your reply or Sign up for a free account.