Click here to Skip to main content
15,912,578 members
Home / Discussions / Visual Basic
   

Visual Basic

 
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 
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 
Here you go, i'll be happy to give some explanation if you want. Big Grin | :-D
Imports System.Runtime.InteropServices

Public NotInheritable Class Api

    <StructLayout(LayoutKind.Explicit)> _
    Private Structure RECT
        <FieldOffset(0)> Public left As Integer
        <FieldOffset(4)> Public top As Integer
        <FieldOffset(8)> Public right As Integer
        <FieldOffset(12)> Public bottom As Integer
    End Structure

    <DllImport("User32.dll", CharSet:=System.Runtime.InteropServices.CharSet.Auto)> _
    Private Shared Function GetWindowRect(ByVal hWnd As IntPtr, ByRef lpRect As RECT) As Boolean
    End Function

    ''' <summary>Get the location of a control in screen coordinates.</summary>
    ''' <param name="control">The control who's location will be returned.</param>
    ''' <returns>Returns the location of the control in screen coordinates.</returns>
    Public Shared Function AbsoluteLocation(ByVal control As Control) As Point
        If (control Is Nothing) Then Throw New ArgumentNullException("control")

        Dim rect As New rect
        GetWindowRect(control.Handle, rect)
        Return New Point(rect.left, rect.top)
    End Function

End Class


Pompiedompiedom... Wink | ;)
"..Commit yourself to quality from day one..it's better to do nothing at all than to do something badly.."
-- Mark McCormick

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 
AnswerRe: Data Control Pin
SoonerFan30-Sep-05 5:09
SoonerFan30-Sep-05 5:09 
Questionproblem regular expression Pin
absprogrammer30-Sep-05 1:37
absprogrammer30-Sep-05 1:37 

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.