Results 1 to 24 of 24

Thread: MsgBoxEx - Extended Message Box

  1. #1

    Thread Starter
    Super Moderator manavo11's Avatar
    Join Date
    Nov 2002
    Location
    Around the corner from si_the_geek
    Posts
    7,171

    MsgBoxEx - Extended Message Box

    Based on the code from Aaron Young I found here : http://www.vbforums.com/showthread.php?t=17725,
    I added some extra features

    1) Now you can move and resize the msgbox easily.
    2) Change Forecolor and Backcolor for the MsgBox.

    Module Code (Post #6) : http://www.vbforums.com/showpost.php...46&postcount=6

    Example (Post #7) : http://www.vbforums.com/showpost.php...51&postcount=7
    Last edited by manavo11; May 30th, 2005 at 02:44 PM. Reason: Updated


    Has someone helped you? Then you can Rate their helpful post.

  2. #2
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,710

    Re: MsgBoxEx - Extended Message Box

    Very nice additional features! Will you be fixing the button and text positioning when the msgbox is sized?
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  3. #3

    Thread Starter
    Super Moderator manavo11's Avatar
    Join Date
    Nov 2002
    Location
    Around the corner from si_the_geek
    Posts
    7,171

    Re: MsgBoxEx - Extended Message Box

    Quote Originally Posted by RobDog888
    Very nice additional features! Will you be fixing the button and text positioning when the msgbox is sized?
    Thanks I'll be adding it shortly


    Has someone helped you? Then you can Rate their helpful post.

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: MsgBoxEx - Extended Message Box

    I concur with RobDog. Very nice! In fact, when you finish I think I'll pop this into a modMsgBox.bas file and make it standard module for all new projects.

  5. #5

    Thread Starter
    Super Moderator manavo11's Avatar
    Join Date
    Nov 2002
    Location
    Around the corner from si_the_geek
    Posts
    7,171

    Re: MsgBoxEx - Extended Message Box

    Quote Originally Posted by Hack
    I concur with RobDog. Very nice! In fact, when you finish I think I'll pop this into a modMsgBox.bas file and make it standard module for all new projects.
    Thanks Hack

    I updated the code. It resizes and moves the buttons now. I'm sure it's not perfect so I'm open to suggestions


    Has someone helped you? Then you can Rate their helpful post.

  6. #6

    Thread Starter
    Super Moderator manavo11's Avatar
    Join Date
    Nov 2002
    Location
    Around the corner from si_the_geek
    Posts
    7,171

    Re: MsgBoxEx - Extended Message Box

    In a standard module :

    VB Code:
    1. '*************************************************************
    2. '* MsgBoxEx() - Written by Aaron Young, February 7th 2000
    3. '*            - Edited by Philip Manavopoulos, May 19th 2005
    4. '*************************************************************
    5.  
    6. Option Explicit
    7.  
    8. Private Type CWPSTRUCT
    9.     lParam As Long
    10.     wParam As Long
    11.     message As Long
    12.     hwnd As Long
    13. End Type
    14.  
    15. 'Added by manavo11
    16. Private Type RECT
    17.     Left As Long
    18.     Top As Long
    19.     Right As Long
    20.     Bottom As Long
    21. End Type
    22.  
    23. Private Type LOGBRUSH
    24.     lbStyle As Long
    25.     lbColor As Long
    26.     lbHatch As Long
    27. End Type
    28. 'Added by manavo11
    29.  
    30. Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (Destination As Any, Source As Any, ByVal Length As Long)
    31. Private Declare Function SetWindowsHookEx Lib "user32" Alias "SetWindowsHookExA" (ByVal idHook As Long, ByVal lpfn As Long, ByVal hmod As Long, ByVal dwThreadId As Long) As Long
    32. Private Declare Function CallNextHookEx Lib "user32" (ByVal hHook As Long, ByVal nCode As Long, ByVal wParam As Long, lParam As Any) As Long
    33. Private Declare Function UnhookWindowsHookEx Lib "user32" (ByVal hHook As Long) As Long
    34. Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
    35. Private Declare Function CallWindowProc Lib "user32" Alias "CallWindowProcA" (ByVal lpPrevWndFunc As Long, ByVal hwnd As Long, ByVal Msg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
    36. Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
    37. Private Declare Function GetClassName Lib "user32" Alias "GetClassNameA" (ByVal hwnd As Long, ByVal lpClassName As String, ByVal nMaxCount As Long) As Long
    38.  
    39. 'Added by manavo11
    40. Private Declare Function SetTextColor Lib "gdi32" (ByVal hdc As Long, ByVal crColor As Long) As Long
    41. Private Declare Function SetBkColor Lib "gdi32" (ByVal hdc As Long, ByVal crColor As Long) As Long
    42. Private Declare Function CreateBrushIndirect Lib "gdi32" (lpLogBrush As LOGBRUSH) As Long
    43. Private Declare Function GetSysColor Lib "user32" (ByVal nIndex As Long) As Long
    44.  
    45. Private Declare Function SetFocus Lib "user32" (ByVal hwnd As Long) As Long
    46.  
    47. Private Declare Function MoveWindow Lib "user32" (ByVal hwnd As Long, ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal bRepaint As Long) As Long
    48. Private Declare Function GetWindowRect Lib "user32" (ByVal hwnd As Long, lpRect As RECT) As Long
    49. Private Declare Function GetClientRect Lib "user32" (ByVal hwnd As Long, lpRect As RECT) As Long
    50.  
    51. Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
    52. Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
    53. 'Added by manavo11
    54.  
    55. Private Const WH_CALLWNDPROC = 4
    56. Private Const GWL_WNDPROC = (-4)
    57. Private Const WM_CTLCOLORBTN = &H135
    58. Private Const WM_DESTROY = &H2
    59. Private Const WM_SETTEXT = &HC
    60. Private Const WM_CREATE = &H1
    61.  
    62. 'Added by manavo11
    63. ' System Color Constants
    64. Private Const COLOR_BTNFACE = 15
    65. Private Const COLOR_BTNTEXT = 18
    66.  
    67. ' Windows Messages
    68. Private Const WM_CTLCOLORSTATIC = &H138
    69. Private Const WM_CTLCOLORDLG = &H136
    70.  
    71. Private Const WM_SHOWWINDOW As Long = &H18
    72. 'Added by manavo11
    73.  
    74. Private lHook As Long
    75. Private lPrevWnd As Long
    76.  
    77. Private bCustom As Boolean
    78. Private sButtons() As String
    79. Private lButton As Long
    80. Private sHwnd As String
    81.  
    82. 'Added by manavo11
    83. Private lForecolor As Long
    84. Private lBackcolor As Long
    85.  
    86. Private sDefaultButton As String
    87.  
    88. Private iX As String
    89. Private iY As String
    90. Private iWidth As String
    91. Private iHeight As String
    92.  
    93. Private iButtonCount As Integer
    94. Private iButtonWidth As Integer
    95. 'Added by manavo11
    96.  
    97. Public Function SubMsgBox(ByVal hwnd As Long, ByVal Msg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
    98.     Dim sText As String
    99.    
    100.     Select Case Msg
    101.    
    102.     'Added by manavo11
    103.     Case WM_SHOWWINDOW
    104.         Dim MsgBoxRect As RECT
    105.        
    106.         GetWindowRect hwnd, MsgBoxRect
    107.        
    108.         If StrPtr(iX) = 0 Then
    109.             iX = MsgBoxRect.Left
    110.         End If
    111.        
    112.         If StrPtr(iY) = 0 Then
    113.             iY = MsgBoxRect.Top
    114.         End If
    115.        
    116.         If StrPtr(iWidth) = 0 Then
    117.             iWidth = MsgBoxRect.Right - MsgBoxRect.Left
    118.         Else
    119.             Dim i As Integer
    120.             Dim h As Long
    121.            
    122.             Dim ButtonRECT As RECT
    123.            
    124.             For i = 0 To iButtonCount
    125.                 h = FindWindowEx(hwnd, h, "Button", vbNullString)
    126.                
    127.                 GetWindowRect h, ButtonRECT
    128.                
    129.                 MoveWindow h, 14 + (iButtonWidth * i) + (6 * i), iHeight - (ButtonRECT.Bottom - ButtonRECT.Top) - 40, iButtonWidth, ButtonRECT.Bottom - ButtonRECT.Top, 1
    130.             Next
    131.         End If
    132.        
    133.         If StrPtr(iHeight) = 0 Then
    134.             iHeight = MsgBoxRect.Bottom - MsgBoxRect.Top
    135.         End If
    136.        
    137.         MoveWindow hwnd, iX, iY, iWidth, iHeight, 1
    138.     Case WM_CTLCOLORDLG, WM_CTLCOLORSTATIC
    139.         Dim tLB As LOGBRUSH
    140.         'Debug.Print wParam
    141.        
    142.         Call SetTextColor(wParam, lForecolor)
    143.         Call SetBkColor(wParam, lBackcolor)
    144.        
    145.         tLB.lbColor = lBackcolor
    146.        
    147.         SubMsgBox = CreateBrushIndirect(tLB)
    148.         Exit Function
    149.     'Added by manavo11
    150.    
    151.     Case WM_CTLCOLORBTN
    152.         'Customize the MessageBox Buttons if neccessary..
    153.         'First Process the Default Action of the Message (Draw the Button)
    154.         SubMsgBox = CallWindowProc(lPrevWnd, hwnd, Msg, wParam, ByVal lParam)
    155.         'Now Change the Button Text if Required
    156.         If Not bCustom Then Exit Function
    157.         If lButton = 0 Then sHwnd = ""
    158.         'If this Button has Been Modified Already then Exit
    159.         If InStr(sHwnd, " " & Trim(Str(lParam)) & " ") Then Exit Function
    160.         sText = sButtons(lButton)
    161.         sHwnd = sHwnd & " " & Trim(Str(lParam)) & " "
    162.         lButton = lButton + 1
    163.         'Modify the Button Text
    164.         SendMessage lParam, WM_SETTEXT, Len(sText), ByVal sText
    165.        
    166.         'Added by manavo11
    167.         If sText = sDefaultButton Then
    168.             SetFocus lParam
    169.         End If
    170.         'Added by manavo11
    171.        
    172.         Exit Function
    173.        
    174.     Case WM_DESTROY
    175.         'Remove the MsgBox Subclassing
    176.         Call SetWindowLong(hwnd, GWL_WNDPROC, lPrevWnd)
    177.     End Select
    178.     SubMsgBox = CallWindowProc(lPrevWnd, hwnd, Msg, wParam, ByVal lParam)
    179. End Function
    180.  
    181. Private Function HookWindow(ByVal nCode As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
    182.     Dim tCWP As CWPSTRUCT
    183.     Dim sClass As String
    184.     'This is where you need to Hook the Messagebox
    185.     CopyMemory tCWP, ByVal lParam, Len(tCWP)
    186.     If tCWP.message = WM_CREATE Then
    187.         sClass = Space(255)
    188.         sClass = Left(sClass, GetClassName(tCWP.hwnd, ByVal sClass, 255))
    189.         If sClass = "#32770" Then
    190.             'Subclass the Messagebox as it's created
    191.             lPrevWnd = SetWindowLong(tCWP.hwnd, GWL_WNDPROC, AddressOf SubMsgBox)
    192.         End If
    193.     End If
    194.     HookWindow = CallNextHookEx(lHook, nCode, wParam, ByVal lParam)
    195. End Function
    196.  
    197. Public Function MsgBoxEx(ByVal Prompt As String, Optional ByVal Buttons As Long = vbOKOnly, Optional ByVal Title As String, Optional ByVal HelpFile As String, Optional ByVal Context As Long, Optional ByRef CustomButtons As Variant, Optional DefaultButton As String, Optional X As String, Optional Y As String, Optional Width As String, Optional Height As String, Optional ByVal ForeColor As ColorConstants = -1, Optional ByVal BackColor As ColorConstants = -1) As Long
    198.     Dim lReturn As Long
    199.    
    200.     bCustom = (Buttons = vbCustom)
    201.     If bCustom And IsMissing(CustomButtons) Then
    202.         MsgBox "When using the Custom option you need to supply some Buttons in the ""CustomButtons"" Argument.", vbExclamation + vbOKOnly, "Error"
    203.         Exit Function
    204.     End If
    205.     lHook = SetWindowsHookEx(WH_CALLWNDPROC, AddressOf HookWindow, App.hInstance, App.ThreadID)
    206.     'Set the Defaults
    207.     If Len(Title) = 0 Then Title = App.Title
    208.     If bCustom Then
    209.         'User wants to use own Button Titles..
    210.         If TypeName(CustomButtons) = "String" Then
    211.             ReDim sButtons(0)
    212.             sButtons(0) = CustomButtons
    213.             Buttons = 0
    214.         Else
    215.             sButtons = CustomButtons
    216.             Buttons = UBound(sButtons)
    217.         End If
    218.     End If
    219.    
    220.     'Added by manavo11
    221.     lForecolor = GetSysColor(COLOR_BTNTEXT)
    222.     lBackcolor = GetSysColor(COLOR_BTNFACE)
    223.    
    224.     If ForeColor >= 0 Then lForecolor = ForeColor
    225.     If BackColor >= 0 Then lBackcolor = BackColor
    226.    
    227.     sDefaultButton = DefaultButton
    228.    
    229.     iX = X
    230.     iY = Y
    231.     iWidth = Width
    232.     iHeight = Height
    233.    
    234.     iButtonCount = UBound(sButtons)
    235.     iButtonWidth = (iWidth - (2 * 14) - (6 * (Buttons + 1))) / (Buttons + 1)
    236.     'Added by manavo11
    237.    
    238.     lButton = 0
    239.    
    240.     'Show the Modified MsgBox
    241.     lReturn = MsgBox(Prompt, Buttons, Title, HelpFile, Context)
    242.     Call UnhookWindowsHookEx(lHook)
    243.     'If it's a Custom Button MsgBox, Alter the Return Value
    244.     If bCustom Then lReturn = lReturn - (UBound(CustomButtons) + 1)
    245.     bCustom = False
    246.     MsgBoxEx = lReturn
    247. End Function


    Has someone helped you? Then you can Rate their helpful post.

  7. #7

    Thread Starter
    Super Moderator manavo11's Avatar
    Join Date
    Nov 2002
    Location
    Around the corner from si_the_geek
    Posts
    7,171

    Re: MsgBoxEx - Extended Message Box

    Example :

    VB Code:
    1. Private Sub Command1_Click()
    2.     Dim aButtons(2) As String
    3.     aButtons(0) = "Go"
    4.     aButtons(1) = "Come"
    5.     aButtons(2) = "???"
    6.  
    7.     Caption = aButtons(MsgBoxEx("Text" & vbCrLf & "More Text" & vbCrLf & "Even More Text", vbCustom, "Title", , , aButtons, aButtons(1), 0, 0, 200, 300, vbWhite, vbBlue))
    8. End Sub


    Has someone helped you? Then you can Rate their helpful post.

  8. #8
    New Member
    Join Date
    Sep 2007
    Posts
    1

    Talking Re: MsgBoxEx - Extended Message Box

    Can we have a background picture on it ?

  9. #9

    Thread Starter
    Super Moderator manavo11's Avatar
    Join Date
    Nov 2002
    Location
    Around the corner from si_the_geek
    Posts
    7,171

    Re: MsgBoxEx - Extended Message Box

    Well, in theory you should be able to, although I haven't tried it... Probably when the same message is called when you set the background color, instead of calling the SetBkColor API, you could call the BitBlt, right? Both take the hdc as a parameter to draw on. So I'm guessing it's possible, but not implemented in the above code


    Has someone helped you? Then you can Rate their helpful post.

  10. #10
    Frenzied Member
    Join Date
    Apr 2003
    Location
    The Future - Skynet
    Posts
    1,157

    Re: MsgBoxEx - Extended Message Box

    manavo11, if you get a chance, can you post your code in VB tags? When I copy your code and past it to a module, it is all bunch up on couple lines.

    Thank You
    I'll Be Back!

    T-1000

    Microsoft .Net 2005
    Microsoft Visual Basic 6
    Prefer using API

  11. #11
    PowerPoster lintz's Avatar
    Join Date
    Mar 2003
    Location
    The 19th Hole
    Posts
    2,697

    Re: MsgBoxEx - Extended Message Box

    Liquid Metal, I read a post that said to copy code (within VB tags) click the 'Quote' button which removes all the line numbers allowing you to copy and paste the code into your project

  12. #12
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,710

    Re: MsgBoxEx - Extended Message Box

    Or check out MartinLiss' signature for his VB Code Copier fix.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  13. #13
    PowerPoster dilettante's Avatar
    Join Date
    Feb 2006
    Posts
    24,482

    Re: MsgBoxEx - Extended Message Box

    How close does it get us to TaskDialog()'s functionality?

    So long MessageBox and thanks for all the memories

  14. #14
    Frenzied Member
    Join Date
    Apr 2003
    Location
    The Future - Skynet
    Posts
    1,157

    Re: MsgBoxEx - Extended Message Box

    Quote Originally Posted by lintz
    Liquid Metal, I read a post that said to copy code (within VB tags) click the 'Quote' button which removes all the line numbers allowing you to copy and paste the code into your project
    I just clicked the Quote button on you and it worked! Thanks for the tip Lintz, it was good.
    I'll Be Back!

    T-1000

    Microsoft .Net 2005
    Microsoft Visual Basic 6
    Prefer using API

  15. #15
    PowerPoster lintz's Avatar
    Join Date
    Mar 2003
    Location
    The 19th Hole
    Posts
    2,697

    Re: MsgBoxEx - Extended Message Box

    Glad to help

  16. #16
    Frenzied Member
    Join Date
    Dec 2007
    Posts
    1,072

    Re: MsgBoxEx - Extended Message Box

    I got a question:

    Code:
    Public Function MsgBoxEx(ByVal Prompt As String, Optional ByVal Buttons As Long = vbOKOnly, Optional ByVal Title As String, Optional ByVal HelpFile As String, Optional ByVal Context As Long, Optional ByRef CustomButtons As Variant, Optional DefaultButton As String, Optional X As String, Optional Y As String, Optional Width As String, Optional Height As String, Optional ByVal ForeColor As ColorConstants = -1, Optional ByVal BackColor As ColorConstants = -1) As Long
    Can't the bolded strings be integers?

  17. #17
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,710

    Re: MsgBoxEx - Extended Message Box

    Where is the bolded parts? It doesnt show.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  18. #18
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,663

    Re: MsgBoxEx - Extended Message Box

    I think it was in ref to this part ( the bold is hard to see, so I also changed the color)
    Code:
    Optional X As String, Optional Y As String, Optional Width As String, Optional Height As String
    Doesn't it make sense to make those Longs instead?

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  19. #19
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,710

    Re: MsgBoxEx - Extended Message Box

    Yes, if your passing numerical data all the time, as in coordinates, then it does make logical sense to change the signature to Integer or Long instead.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  20. #20
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,663

    Re: MsgBoxEx - Extended Message Box

    Well, I'm think that until VB recognizes "four hundred fifty-eight" as a number.... it's pretty safe (possibly safer) to change it to longs to allow 458...



    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  21. #21
    New Member
    Join Date
    Jul 2010
    Posts
    3

    Re: MsgBoxEx - Extended Message Box

    nice coding but cant we increase the font size......please

  22. #22
    Lively Member
    Join Date
    Feb 2009
    Posts
    72

    Re: MsgBoxEx - Extended Message Box

    Dear All,

    These code can not show the Unicode message.

    LVD

  23. #23
    New Member
    Join Date
    Aug 2021
    Posts
    1

    Re: MsgBoxEx - Extended Message Box

    vb6 & win 10
    Tried code and have problems
    1)The left lower corner of the msgbox is grey, and not color selected
    2)Sub Script out of range error after pressing btn #1

    Thanks for any HELP

    NO HELP!!
    So I took some ones advise and created my own.
    Size, location, backcolor, forecolor, 1 to 3 buttons
    button size, color & location
    Message text size, color & location

    Last edited by khkv8; Aug 12th, 2021 at 06:13 PM. Reason: Up Date

  24. #24
    Addicted Member
    Join Date
    Aug 2009
    Location
    Anywhere I want to.
    Posts
    169

    Re: MsgBoxEx - Extended Message Box

    Late to the party !
    I need to change the Font for the Message Text and the BUTTONS.

    How do i do that ?
    Or is there a newer VB6 MsgBox code that has that feature?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width