Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Getting a Dialog Box to show where I want it to.
Message
From
02/02/2009 13:31:55
 
 
To
01/02/2009 00:23:50
General information
Forum:
ASP.NET
Category:
Forms
Miscellaneous
Thread ID:
01378200
Message ID:
01378809
Views:
8
Bonnie,

This looks great, but I'm still not getting exactly what I was working for. The dialogbox is close to the original textbox, but not quite. So I'm wondering about from what point is the Location property on the dialogbox in relation to? Is there a property in the dialogbox form that tells it that location is in reference to? There's a Start Position property, but I don't know if that's it and if so, which setting is the right one in this case.

bob

>Hi Bob,
>
>The trick is to get the location of your control in respect to the TopLevelControl, and also you have to use a new System.Drawing.Point. So, you need to do something like this:
>
>
>Control o = this.MyTextBox;
>int Top  = o.Top;
>int Left = o.Left;
>while (o.Equals(this.TopLevelControl) == false)
>{
>	Top = Top + o.Top;
>	Left = Left + o.Left;
>	o = o.Parent;
>}
>
>SearchPopUp.Location = new System.Drawing.Point(Left, Top);
>
>
>~~Bonnie
>
>
>
>
>>I have a Windows Form, that has a Panel, that has a textbox/button combo on it. When I click the button, I'd like a search window to popup right next to the Textbox. I'm not really sure how to reference the location so that I can achieve this. I've tried the following code in the click event of the button, but it doesn't do seem anything.
>>
>>SearchPopUp.Location = this.Location;
>>
>>Any ideas? Thanks!!
>>
>>bob
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform