Click here to Skip to main content
15,888,527 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: How do I Rectify the Closure of a Form Pin
Bernhard Hiller9-Apr-14 22:11
Bernhard Hiller9-Apr-14 22:11 
GeneralRe: How do I Rectify the Closure of a Form Pin
Member 107017019-Apr-14 23:21
Member 107017019-Apr-14 23:21 
AnswerRe: How do I Rectify the Closure of a Form Pin
Alan N10-Apr-14 2:07
Alan N10-Apr-14 2:07 
GeneralRe: How do I Rectify the Closure of a Form Pin
Member 1070170110-Apr-14 2:49
Member 1070170110-Apr-14 2:49 
Question[vb2008] Chart from CSV file Pin
Member 107354929-Apr-14 5:40
Member 107354929-Apr-14 5:40 
AnswerRe: [vb2008] Chart from CSV file Pin
Richard MacCutchan9-Apr-14 6:29
mveRichard MacCutchan9-Apr-14 6:29 
AnswerRe: [vb2008] Chart from CSV file Pin
Eddy Vluggen9-Apr-14 6:31
professionalEddy Vluggen9-Apr-14 6:31 
QuestionGetting error 'AddressOf' expression cannot be converted to 'Integer' Pin
Ankush Seth7-Apr-14 23:27
Ankush Seth7-Apr-14 23:27 
Hell every one
I converted my vb6 project to vb.net and having this error.

My code is
VB
Public Function CenterMessageBox(ByRef frmHwnd As Integer) As Object
        '******************************
        'WARNING: NOT FOLLOWING BELOW INSTRUCTIONS EXACTLY
        'COULD CRASH YOUR APPLICATION

        'INSTRUCTIONS:

        '1. YOU MUST PUT ALL THIS CODE IS A .BAS MODULE

        '2. YOU CALL THIS CODE IMMEDIATELY BEFORE DISPLAYING A MSGBOX,

        '3.  PASS IN THE hWnd Property of Form as parameter

        'Example:

        'CenterMessageBox me.hwnd
        'MsgBox "This is a centered Message Box"
        '*********************************
        Dim lInstance As Integer
        Dim lThreadID As Integer

        'Set up message hook
        lInstance = GetWindowLong(frmHwnd, GWL_HINSTANCE)
        lThreadID = GetCurrentThreadId()
        'UPGRADE_WARNING: Add a delegate for AddressOf CenterMsgCallBack Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="E9E157F7-EF0C-4016-87B7-7D7FBBC6EE08"'
        plMsgHook = SetWindowsHookEx(WH_CBT, AddressOf CenterMsgCallBack, lInstance, lThreadID)

    End Function


and

VB
Private Function CenterMsgCallBack(ByVal lMsg As Integer, ByVal wParam As Integer, ByVal lParam As Integer) As Integer

        Dim typFormRect As RECT
        Dim typRectMsg As RECT
        Dim lxPos, lyPos As Integer

        'HCBT_ACTIVATE = MSG SENT WHEN MSGBOX IS ACTIVATED
        'wParam = handle to msgbox
        If lMsg = HCBT_ACTIVATE Then
            'resolve center of form

            'form rectangle
            GetWindowRect(frmMain.Handle.ToInt32, typFormRect)

            'msgbox rectangle
            GetWindowRect(wParam, typRectMsg)

            'Determine x and y
            lxPos = (typFormRect.Left_Renamed + (typFormRect.Right_Renamed - typFormRect.Left_Renamed) / 2) - ((typRectMsg.Right_Renamed - typRectMsg.Left_Renamed) / 2)

            lyPos = (typFormRect.Top + (typFormRect.Bottom - typFormRect.Top) / 2) - ((typRectMsg.Bottom - typRectMsg.Top) / 2)

            'Position
            SetWindowPos(wParam, 0, lxPos, lyPos, 0, 0, SWP_NOSIZE Or SWP_NOZORDER Or SWP_NOACTIVATE)

            'Release the hook
            UnhookWindowsHookEx(plMsgHook)
        End If

        CenterMsgCallBack = False

    End Function


Please tell me what to do. I don't know this programming language and i have searched the answer of it but not getting how to implememt. Please help I will be thankful to you
AnswerRe: Getting error 'AddressOf' expression cannot be converted to 'Integer' Pin
Richard Deeming8-Apr-14 2:25
mveRichard Deeming8-Apr-14 2:25 
QuestionError : Property is readonly Pin
dilkonika6-Apr-14 8:42
dilkonika6-Apr-14 8:42 
AnswerRe: Error : Property is readonly Pin
Bernhard Hiller6-Apr-14 21:24
Bernhard Hiller6-Apr-14 21:24 
GeneralRe: Error : Property is readonly Pin
dilkonika7-Apr-14 2:50
dilkonika7-Apr-14 2:50 
GeneralRe: Error : Property is readonly Pin
Eddy Vluggen7-Apr-14 7:22
professionalEddy Vluggen7-Apr-14 7:22 
GeneralRe: Error : Property is readonly Pin
dilkonika7-Apr-14 7:49
dilkonika7-Apr-14 7:49 
GeneralRe: Error : Property is readonly Pin
Eddy Vluggen7-Apr-14 8:53
professionalEddy Vluggen7-Apr-14 8:53 
GeneralRe: Error : Property is readonly Pin
dilkonika7-Apr-14 9:44
dilkonika7-Apr-14 9:44 
GeneralRe: Error : Property is readonly Pin
Eddy Vluggen8-Apr-14 8:01
professionalEddy Vluggen8-Apr-14 8:01 
QuestionCalculations Help! Pin
Member 107286676-Apr-14 8:33
Member 107286676-Apr-14 8:33 
AnswerRe: Calculations Help! Pin
Dave Kreskowiak6-Apr-14 8:37
mveDave Kreskowiak6-Apr-14 8:37 
GeneralRe: Calculations Help! Pin
Member 107286676-Apr-14 8:48
Member 107286676-Apr-14 8:48 
GeneralRe: Calculations Help! Pin
Member 107286676-Apr-14 8:49
Member 107286676-Apr-14 8:49 
GeneralRe: Calculations Help! Pin
Member 107286676-Apr-14 8:50
Member 107286676-Apr-14 8:50 
GeneralRe: Calculations Help! Pin
Mycroft Holmes6-Apr-14 12:55
professionalMycroft Holmes6-Apr-14 12:55 
GeneralRe: Calculations Help! Pin
Eddy Vluggen7-Apr-14 7:46
professionalEddy Vluggen7-Apr-14 7:46 
AnswerRe: Calculations Help! Pin
ZurdoDev7-Apr-14 8:46
professionalZurdoDev7-Apr-14 8:46 

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.