Results 1 to 21 of 21

Thread: status bar help VB6

  1. #1

    Thread Starter
    Member
    Join Date
    Apr 2007
    Posts
    37

    Lightbulb status bar help VB6

    I need a status bar . I want something like when you are looking up a site it will say what it is looking up ( loading page ) and when its down i want a BOLD text saying ( YOUR PAGE IS DONE ) and it will stop there untill next look up or clicked on any urls.

    Its like a progress bar and status to together.
    so ill do an Example:



    I want something like that Together. How IE has theres. When your looking up a page it will give you the frist Arrow in picture In black TEXT. Then when its done it will say done at the buttom corner like on the second picture there
    on the buttom. then saying done i want it to say YOUR PAGE BEEN LOADED.

    Thanks: Cody.
    I dont know how to do it lol im not that smart lol

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

    Re: status bar help VB6

    You can do it with javascript or html code in your web page.

    window.status = "Your page is loaded"

    But you can not do bolding or change the style of the text.
    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
    Member
    Join Date
    Apr 2007
    Posts
    37

    Re: status bar help VB6

    what would i need . i know a statis bar and that but other then that the code you gave me didnt work in the statis bar.

    vb Code:
    1. Private Sub StatusBar1_PanelClick(ByVal Panel As MSComctlLib.Panel)
    2. window.status = "Your page is loaded"
    3. End Sub

    please give me a list what i need and what i need it to be. im not good with status bars i tryed it few times and didnt get it at all. i dont know if you would do this but i want a loading bar blow . if you dont want to do the bar thats fine. but im looking for both.

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

    Re: status bar help VB6

    Its javascript not vb.

    Is this for your webpage or for a custom vb web browser? You didnt state.
    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

  5. #5

    Thread Starter
    Member
    Join Date
    Apr 2007
    Posts
    37

    Re: status bar help VB6

    im adding on a web browser of mine in Visual basic 6 i need a web status bar on the web browser. with this:



    But i need a progress bar and status bar on the STATUS BAR. if you know what i mean. i want it to look like IEs status bar. But DONE change it to YOUR PAGE IS LOADED.
    Last edited by ccps; Apr 17th, 2007 at 04:07 PM.

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

    Re: status bar help VB6

    Ok, then use the Webbrowser1_DocumentComplete event to change th statusbar to what you want it to say.

    vb Code:
    1. Option Explicit
    2.  
    3. Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
    4.     WebBrowser1.StatusText = "Document completed loading"
    5. End Sub
    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

  7. #7

    Thread Starter
    Member
    Join Date
    Apr 2007
    Posts
    37

    Re: status bar help VB6

    i dont get where to put it . im a noob at this status bar crap. do i put it in the stats bar code or add it to the form ?

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

    Re: status bar help VB6

    Do you have a webbrowser ontrol on your form? Place the code behind the form and make sure whatever you named your webbrowser control that it reflects that name in the event procedure "webbrowser1_documentcomplete"
    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

  9. #9

    Thread Starter
    Member
    Join Date
    Apr 2007
    Posts
    37

    Re: status bar help VB6

    yeah its called Webbrowser1. But i dont know if i just stick it behind a Button or Status bar or something , you know what i mean behind the bar. like under that catagory (code).

  10. #10

    Thread Starter
    Member
    Join Date
    Apr 2007
    Posts
    37

    Re: status bar help VB6

    Do i need to make a status bar . lol .

  11. #11
    Frenzied Member zynder's Avatar
    Join Date
    Nov 2006
    Location
    localhost
    Posts
    1,434

    Re: status bar help VB6

    Press Ctrl + T to open component window then check "Microsoft Windows Common Control 6.0 or 5.0.

    Drag the status bar to your form.

    then

    Code:
    Private Sub WebBrowser1_StatusTextChange(ByVal Text As String)
        'status bar
        StatusBar1.Panels.Item(1).Text = Text
    End Sub

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

    Re: status bar help VB6

    What was I thinking lol.

    Here is as you asked.

    Code:
    Option Explicit
    
    Private Sub Form_Load()
        WebBrowser1.Navigate2 "http://vbforums.com"
    End Sub
    
    Private Sub WebBrowser1_BeforeNavigate2(ByVal pDisp As Object, URL As Variant, Flags As Variant, _
        TargetFrameName As Variant, PostData As Variant, Headers As Variant, Cancel As Boolean)
        StatusBar1.Panels(1).Text = "Your page is loading..."
    End Sub
    
    Private Sub WebBrowser1_NavigateComplete2(ByVal pDisp As Object, URL As Variant)
        If (pDisp Is WebBrowser1.Object) = True Then
            StatusBar1.Panels(1).Text = "Your page is loaded"
        End If
    End Sub
    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
    Frenzied Member zynder's Avatar
    Join Date
    Nov 2006
    Location
    localhost
    Posts
    1,434

    Re: status bar help VB6

    Well, that's the same with post #11 however mine is just the same as how Internet Explorer handles the status and it's a bit shorter.

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

    Re: status bar help VB6

    I know but he wanted to show his own messages. Using the StatusTextChange event you can not easily determine what is going on.
    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

  15. #15
    Frenzied Member zynder's Avatar
    Join Date
    Nov 2006
    Location
    localhost
    Posts
    1,434

    Re: status bar help VB6

    Oh I see. I havent read it in post #5. He edited his post or i totally missed reading the last part.

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

    Re: status bar help VB6

    Lol, may need to read again

    ...But DONE change it to YOUR PAGE IS LOADED.
    My way also give the opportunity for him to have other custom "status'"
    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

  17. #17
    Frenzied Member zynder's Avatar
    Join Date
    Nov 2006
    Location
    localhost
    Posts
    1,434

    Re: status bar help VB6

    Quote Originally Posted by RobDog888
    What was I thinking lol.

    Here is as you asked.

    Code:
    Option Explicit
    
    Private Sub Form_Load()
        WebBrowser1.Navigate2 "http://vbforums.com"
    End Sub
    
    Private Sub WebBrowser1_BeforeNavigate2(ByVal pDisp As Object, URL As Variant, Flags As Variant, _
        TargetFrameName As Variant, PostData As Variant, Headers As Variant, Cancel As Boolean)
        StatusBar1.Panels(1).Text = "Your page is loading..."
    End Sub
    
    Private Sub WebBrowser1_NavigateComplete2(ByVal pDisp As Object, URL As Variant)
        If (pDisp Is WebBrowser1.Object) = True Then
            StatusBar1.Panels(1).Text = "Your page is loaded"    End If
    End Sub
    Hey Rob you're not getting it right.

    It's suppose to be

    Code:
     StatusBar1.Panels(1).Text = "YOUR PAGE IS LOADED"
    All caps! lol.

  18. #18
    Giants World Champs!!!! Mark Gambo's Avatar
    Join Date
    Sep 2003
    Location
    Colorado
    Posts
    2,965

    Re: status bar help VB6

    Quote Originally Posted by ccps
    I need a status bar . I want something like when you are looking up a site it will say what it is looking up ( loading page ) and when its down i want a BOLD text saying ( YOUR PAGE IS DONE ) and it will stop there untill next look up or clicked on any urls. . . .(
    If you want to add formatting to a Statusbar's Panel, you could always use put a RichTextBox inside of a Statusbar Panel and then format the text anyway you like:

    VB Code:
    1. Option Explicit
    2.  
    3. Private Declare Function SetParent Lib "user32" _
    4.   (ByVal hWndChild As Long, _
    5.    ByVal hWndNewParent As Long) As Long
    6.    
    7.  
    8. Private Sub Command1_Click()
    9. Dim strText() As String
    10. Dim a As Long
    11.  
    12. StatusBar1.Panels.Item(1).AutoSize = sbrSpring
    13.    
    14.     With RichTextBox1
    15.         Call SetParent(.hWnd, StatusBar1.hWnd)
    16.         .BackColor = .Container.BackColor
    17.         .Move 0, 0, StatusBar1.Panels.Item(1).Width, .Container.Height
    18.         .Text = "Statusbar Message in Color"
    19.         strText = Split(.Text, " ")
    20.        
    21.         For a = 0 To UBound(strText)
    22.             .SelStart = InStr(.Text, strText(a)) - 1
    23.             .SelLength = Len(strText(a))
    24.             .SelColor = Choose(a + 1, vbBlue, vbRed, vbGreen, vbBlack, vbYellow)
    25.             If a Mod 2 Then .SelBold = True Else .SelBold = False
    26.             If a Mod 3 Then .SelItalic = True Else .SelItalic = False
    27.         Next a
    28.        
    29.     End With
    30. End Sub
    31.  
    32. Private Sub Form_Resize()
    33.     RichTextBox1.Move 0, 0, StatusBar1.Panels.Item(1).Width, StatusBar1.Height
    34. End Sub
    Attached Images Attached Images  
    Last edited by Mark Gambo; Apr 18th, 2007 at 07:10 AM.
    Regards,

    Mark

    Please remember to rate posts! Rate any post you find helpful. Use the link to the left - "Rate this Post". Please use [highlight='vb'] your code goes in here [/highlight] tags when posting code. When a question you asked has been resolved, please go to the top of the original post and click "Thread Tools" then select "Mark Thread Resolved."


  19. #19
    PowerPoster
    Join Date
    Feb 2006
    Location
    East of NYC, USA
    Posts
    5,691

    Re: status bar help VB6

    Quote Originally Posted by ccps
    But i dont know if i just stick it behind a Button or Status bar or something , you know what i mean behind the bar. like under that catagory (code).
    WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant) is an event handler, so you put it in a clear space in the code window for the form the control the event is connected to (WebBrowser1, in this case) is located on. The easiest way to be sure is to put it at the bottom of any existing code. (Option Explicit always goes at the top of every code window, to help you find typos in your code.)
    Last edited by Al42; Apr 18th, 2007 at 10:58 AM.
    The most difficult part of developing a program is understanding the problem.
    The second most difficult part is deciding how you're going to solve the problem.
    Actually writing the program (translating your solution into some computer language) is the easiest part.

    Please indent your code and use [HIGHLIGHT="VB"] [/HIGHLIGHT] tags around it to make it easier to read.

    Please Help Us To Save Ana

  20. #20

    Thread Starter
    Member
    Join Date
    Apr 2007
    Posts
    37

    Re: status bar help VB6

    thanks

  21. #21
    Member MSWindowsUser's Avatar
    Join Date
    Dec 2007
    Posts
    40

    Re: status bar help VB6

    Code:
    WebBrowser1_ProgressChange(ByVal Progress as Inteter, ByVal ProgressMax as Integer)
        If ProgressBar1.Value = 0 Then
            StatusBar1.Panels(1).Text = "Done"
        End If
    End Sub

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