Click here to Skip to main content
15,893,487 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Exporting a Datagrid to Excel Pin
Dave Kreskowiak1-Oct-05 3:04
mveDave Kreskowiak1-Oct-05 3:04 
GeneralRe: Exporting a Datagrid to Excel Pin
raysot7771-Oct-05 9:38
raysot7771-Oct-05 9:38 
QuestionRefreshing Reports in Crystal Reports 9 Pin
shoaibnawaz30-Sep-05 8:53
shoaibnawaz30-Sep-05 8:53 
QuestionHow do you calc the absolute location of a control? Pin
watagal30-Sep-05 8:06
watagal30-Sep-05 8:06 
AnswerRe: How do you calc the absolute location of a control? Pin
rwestgraham30-Sep-05 9:28
rwestgraham30-Sep-05 9:28 
QuestionRe: How do you calc the absolute location of a control? Pin
watagal30-Sep-05 13:39
watagal30-Sep-05 13:39 
AnswerRe: How do you calc the absolute location of a control? Pin
rwestgraham30-Sep-05 15:34
rwestgraham30-Sep-05 15:34 
AnswerRe: How do you calc the absolute location of a control? Pin
watagal1-Oct-05 3:33
watagal1-Oct-05 3:33 
watagal wrote:
Greetings!

If I have a control in a split-panel, which is in a tab control, which is in a form -- how can I obtain the absolute location of the original (button) control?

See non-working code in original post


X and Y are never incremented because o.Parent.Name always return "".

Is there a better way (one that actually works) of trying to do this?


Ok, figured out what was happening: The first parent above my button was a split panel, while the actual split panel returns the correct Name -- the Panel1 container within the split panel container does not return a Name (I guess because you can not assign it a name). Therefore, my while loop was never entered.

Here's code that does work:

Dim o As Control = uxLogPhotosToDbBtn
Dim x As Integer = 0
Dim y As Integer = 0
While (Not o Is Nothing)
    x += o.Location.X
    y += o.Location.Y
    o = o.Parent
End While

Dim p1 As Point
p1.X = x
p1.Y = y
uxcLogFotosForm.Show()
uxcLogFotosForm.Location = p1


Thanks again for all the help,



Thanks,
Karen

Nooobie to OOP and VB.Net 2005
QuestionRe: How do you calc the absolute location of a control? Pin
watagal1-Oct-05 3:54
watagal1-Oct-05 3:54 
AnswerRe: How do you calc the absolute location of a control? Pin
[Marc]1-Oct-05 5:45
[Marc]1-Oct-05 5:45 
QuestionInfinite loop - Resizing Form Pin
watagal30-Sep-05 7:06
watagal30-Sep-05 7:06 
AnswerRe: Infinite loop - Resizing Form Pin
Richard_Wolf30-Sep-05 7:52
Richard_Wolf30-Sep-05 7:52 
AnswerRe: Infinite loop - Resizing Form Pin
Member 219430730-Sep-05 7:55
Member 219430730-Sep-05 7:55 
AnswerRe: Infinite loop - Resizing Form Pin
Dave Kreskowiak30-Sep-05 7:56
mveDave Kreskowiak30-Sep-05 7:56 
AnswerRe: Infinite loop - Resizing Form Pin
watagal30-Sep-05 8:09
watagal30-Sep-05 8:09 
QuestionSet Properties in App.config Pin
Mike0930-Sep-05 6:50
Mike0930-Sep-05 6:50 
AnswerRe: Set Properties in App.config Pin
rwestgraham30-Sep-05 9:36
rwestgraham30-Sep-05 9:36 
QuestionDebug Skill?? Pin
hung_ngole30-Sep-05 3:53
hung_ngole30-Sep-05 3:53 
AnswerRe: Debug Skill?? Pin
Dave Kreskowiak30-Sep-05 7:37
mveDave Kreskowiak30-Sep-05 7:37 
GeneralRe: Debug Skill?? Pin
hung_ngole30-Sep-05 15:03
hung_ngole30-Sep-05 15:03 
GeneralRe: Debug Skill?? Pin
Dave Kreskowiak1-Oct-05 3:14
mveDave Kreskowiak1-Oct-05 3:14 
QuestionData Control Pin
SoonerFan30-Sep-05 3:15
SoonerFan30-Sep-05 3:15 
AnswerRe: Data Control Pin
Briga30-Sep-05 3:32
Briga30-Sep-05 3:32 
AnswerRe: Data Control Pin
PatriceB30-Sep-05 3:35
PatriceB30-Sep-05 3:35 
AnswerRe: Data Control Pin
SoonerFan30-Sep-05 4:52
SoonerFan30-Sep-05 4:52 

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.