Page 1 of 2 12 LastLast
Results 1 to 40 of 50

Thread: VB6 -- Disable Scroll Bars in Webbrowser

  1. #1

    Thread Starter
    Lively Member wiz....'s Avatar
    Join Date
    Nov 2008
    Location
    Asia, Earth, Solar System, Milky Way Galaxy, Near Andromeda Galaxy, Universe
    Posts
    78

    VB6 -- Disable Scroll Bars in Webbrowser

    Hey Guyz !!!! Wanted ur help !!!

    How can I disable the scroll bars in a webbrowser ??

    Thnx fr ur help in advance !!!!
    PAIN n SUFFERING-Pain is Inevitable,,suffering is optional...........
    WORK EXPECTATION--U can do anything in this world if u don't look for credit.........

  2. #2
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,652

    Re: VB6 -- Disable Scroll Bars in Webbrowser


    If my post was helpful to you, then express your gratitude using Rate this Post.
    And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
    My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet

    Social Group: VBForums - Developers from India


    Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...

  3. #3

    Thread Starter
    Lively Member wiz....'s Avatar
    Join Date
    Nov 2008
    Location
    Asia, Earth, Solar System, Milky Way Galaxy, Near Andromeda Galaxy, Universe
    Posts
    78

    Re: VB6 -- Disable Scroll Bars in Webbrowser

    I did try it out.....but i get an error !!!!!

    Compile error:

    Constants, fixed-length strings, arrays,user-defined types and declare statements not allowed as Public members of object modules



    wt2 do !?
    PAIN n SUFFERING-Pain is Inevitable,,suffering is optional...........
    WORK EXPECTATION--U can do anything in this world if u don't look for credit.........

  4. #4
    Frenzied Member TheBigB's Avatar
    Join Date
    Mar 2006
    Location
    *Stack Trace*
    Posts
    1,511

    Re: VB6 -- Disable Scroll Bars in Webbrowser

    Did you just copy and paste it in?
    Can you attach the project?

    Note that this part should go above all other code in the form
    Code:
    Public Declare Function EnableScrollBar Lib "user32.dll" (ByVal hWnd As Long, _
    ByVal wSBflags As Long, ByVal wArrows As Long) As Long
    
    'SCROLLBAR CONSTS
    Public Const SB_HORZ As Long = 0
    Public Const SB_VERT As Long = 1
    Public Const SB_CTL As Long = 2
    Public Const SB_BOTH As Long = 3
    
    Public Const ESB_DISABLE_BOTH = &H3
    Public Const ESB_DISABLE_DOWN = &H2
    Public Const ESB_DISABLE_LEFT = &H1
    Public Const ESB_DISABLE_RIGHT = &H2
    Public Const ESB_DISABLE_UP = &H1
    Public Const ESB_ENABLE_BOTH = &H0
    And this in Form_Load or something
    Code:
    Call EnableScrollBar(WebBrowser1.hWnd, SB_BOTH, ESB_DISABLE_BOTH)
    Delete it. They just clutter threads anyway.

  5. #5

    Thread Starter
    Lively Member wiz....'s Avatar
    Join Date
    Nov 2008
    Location
    Asia, Earth, Solar System, Milky Way Galaxy, Near Andromeda Galaxy, Universe
    Posts
    78

    Re: VB6 -- Disable Scroll Bars in Webbrowser

    The constants part is in Red..........!!!

    N please find the file attached !!!!!
    Attached Files Attached Files
    PAIN n SUFFERING-Pain is Inevitable,,suffering is optional...........
    WORK EXPECTATION--U can do anything in this world if u don't look for credit.........

  6. #6
    Frenzied Member TheBigB's Avatar
    Join Date
    Mar 2006
    Location
    *Stack Trace*
    Posts
    1,511

    Re: VB6 -- Disable Scroll Bars in Webbrowser

    Oh I see.
    Public declarations are only allowed in a modules.
    You should change all Public to Private; see attachment.
    I did though now have a problem with the webbrowser control; somehow raises an error on retrieving the hWnd.
    Might be my computer that's quirking or might be a IE7/8 related issue.
    Attached Files Attached Files
    Delete it. They just clutter threads anyway.

  7. #7

    Thread Starter
    Lively Member wiz....'s Avatar
    Join Date
    Nov 2008
    Location
    Asia, Earth, Solar System, Milky Way Galaxy, Near Andromeda Galaxy, Universe
    Posts
    78

    Re: VB6 -- Disable Scroll Bars in Webbrowser

    I face the same problem
    PAIN n SUFFERING-Pain is Inevitable,,suffering is optional...........
    WORK EXPECTATION--U can do anything in this world if u don't look for credit.........

  8. #8
    Junior Member
    Join Date
    Jan 2012
    Posts
    22

    Re: VB6 -- Disable Scroll Bars in Webbrowser

    dr the big when i downloaded ind tried to run it i got an error msg method hwnd of object iwebbrowser2 failed

  9. #9
    PowerPoster
    Join Date
    Aug 2011
    Location
    B.C., Canada
    Posts
    2,887

    Re: VB6 -- Disable Scroll Bars in Webbrowser

    I have a project i made to display animated pictures and it displays it in webbrowser with no scrollbar... i can check tonight when i go on my comuter! if i used that api to remove them...

    What version of windows do you have

  10. #10
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: VB6 -- Disable Scroll Bars in Webbrowser

    Quote Originally Posted by solo.mero View Post
    dr the big when i downloaded ind tried to run it i got an error msg method hwnd of object iwebbrowser2 failed
    You can't use the webbrowser handle (WebBrowser.hwnd) as it is an invalid property even though it is shown in the properties window


    Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.

  11. #11
    Junior Member
    Join Date
    Jan 2012
    Posts
    22

    Re: VB6 -- Disable Scroll Bars in Webbrowser

    but the attachment file of dr big used like that

  12. #12
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: VB6 -- Disable Scroll Bars in Webbrowser

    I know he used that but it is what I said - you can't use WebBrowser.hwnd. You have to get the handle indirectly. Even if you did get the handle that method will not work for the WebBrowser. It will work for a Text box
    Last edited by jmsrickland; Jul 1st, 2012 at 11:21 AM.


    Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.

  13. #13
    Junior Member
    Join Date
    Jan 2012
    Posts
    22

    Re: VB6 -- Disable Scroll Bars in Webbrowser

    can u explain by an example attachment sir ?

  14. #14
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: VB6 -- Disable Scroll Bars in Webbrowser

    Quote Originally Posted by solo.mero View Post
    can u explain by an example attachment sir ?
    It will not disable scroll bars for the WebBrowser.

    It will disable scroll bars for a Text box but they will re-appear as soon as you type text into the text box.

    On a Form put a Command button and a Text box. Set the text box to MultiLine = True and enable both scrollbars

    In the Form code paste below

    Code:
    Private Declare Function EnableScrollBar Lib "user32.dll" (ByVal hwnd As Long, ByVal wSBflags As Long, ByVal wArrows As Long) As Long
    
    Private Const SB_HORZ As Long = 0
    Private Const SB_VERT As Long = 1
    Private Const SB_CTL As Long = 2
    Private Const SB_BOTH As Long = 3
    
    Private Const ESB_DISABLE_BOTH = &H3
    Private Const ESB_DISABLE_DOWN = &H2
    Private Const ESB_DISABLE_LEFT = &H1
    Private Const ESB_DISABLE_RIGHT = &H2
    Private Const ESB_DISABLE_UP = &H1
    Private Const ESB_ENABLE_BOTH = &H0
    
    Private Sub Command1_Click()
     EnableScrollBar Text1.hwnd, SB_BOTH, ESB_DISABLE_BOTH
    End Sub
    1) Type a lot of text into the text box so that both scroll bars show
    2) Click Command1 and see the bars disabled.
    3) Type some more text and you will see the bars re-appear


    Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.

  15. #15
    Junior Member
    Join Date
    Jan 2012
    Posts
    22

    Re: VB6 -- Disable Scroll Bars in Webbrowser

    but i need it for webbrowser brother!

  16. #16
    PowerPoster
    Join Date
    Aug 2011
    Location
    B.C., Canada
    Posts
    2,887

    Re: VB6 -- Disable Scroll Bars in Webbrowser

    I will post code in a bit for webbrowser scrollbars... its Canada Day!! Happy Canada Day everyone!
    I will be home in a cople hours... if you guys havent got any working code

  17. #17
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: VB6 -- Disable Scroll Bars in Webbrowser

    Quote Originally Posted by solo.mero View Post
    but i need it for webbrowser brother!
    I know what you need it for but I told you it doesn't work. I also told you you can't use WebBrowser1.hwnd.

    Wait 'till Max187Boucher posts his code - maybe his will work


    Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.

  18. #18
    Junior Member
    Join Date
    Jan 2012
    Posts
    22

    Re: VB6 -- Disable Scroll Bars in Webbrowser

    ok im waiting

  19. #19
    PowerPoster
    Join Date
    Aug 2011
    Location
    B.C., Canada
    Posts
    2,887

    Re: VB6 -- Disable Scroll Bars in Webbrowser

    is it for a website or to load pictures?

  20. #20
    PowerPoster
    Join Date
    Aug 2011
    Location
    B.C., Canada
    Posts
    2,887

    Re: VB6 -- Disable Scroll Bars in Webbrowser

    try this guys
    Attached Files Attached Files

  21. #21
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: VB6 -- Disable Scroll Bars in Webbrowser

    Can't get any simpler than that


    Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.

  22. #22
    PowerPoster
    Join Date
    Aug 2011
    Location
    B.C., Canada
    Posts
    2,887

    Re: VB6 -- Disable Scroll Bars in Webbrowser

    wont work on ALL websites tho... try this websites... BEWARE ... yes it was simple haha... i just coudln't remember

  23. #23
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: VB6 -- Disable Scroll Bars in Webbrowser

    Won't work on any site if you do anything to make something load - like typing something in the search box on Google brings back the scroll bars. This appears to only work after a page is loaded since each page resets the bars and you are using WebBrowser1.Document.body which will change from one page to another. Therefore it needs to be done in the _DocumentComplete event after each page is loaded.


    Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.

  24. #24
    PowerPoster
    Join Date
    Aug 2011
    Location
    B.C., Canada
    Posts
    2,887

    Re: VB6 -- Disable Scroll Bars in Webbrowser

    yes that is right i just gave an example to show how its done (if it can be done)
    so i guess this is solved thats as far as you can get.... unless you could find something better i call it Resolved!

  25. #25
    Junior Member
    Join Date
    Jan 2012
    Posts
    22

    Re: VB6 -- Disable Scroll Bars in Webbrowser

    its still working :-(
    Attached Images Attached Images  

  26. #26
    PowerPoster
    Join Date
    Aug 2011
    Location
    B.C., Canada
    Posts
    2,887

    Re: VB6 -- Disable Scroll Bars in Webbrowser

    If its where the usernames appear you will have to use the webbrowser commands i attached after you receive or send message/command or receive message/command. It goes away like jmsrickland described.. you just have to be smart about it... and why do you need to use webbrowser for that?

  27. #27
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: VB6 -- Disable Scroll Bars in Webbrowser

    If you don't want your scroll bars to show, although the original question was to be disabled, you can put the WebBrowser inside a picture box and hide the right and bottom edges behind the picture box right and bottom edges just enough so that the scroll bars don't show


    Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.

  28. #28
    PowerPoster
    Join Date
    Aug 2011
    Location
    B.C., Canada
    Posts
    2,887

    Re: VB6 -- Disable Scroll Bars in Webbrowser

    Good idea jmsrickland that would be alot easier to deal with! But still i dont understand why webbrowser? Why not richtextbox or something that will not give you trouble like that.

  29. #29
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: VB6 -- Disable Scroll Bars in Webbrowser

    It might depend on what the webbrowser is being used for. I did a chat program using webbrowser instead of a regular text box or a rich text box because I wanted to have transparent images (like emots) and you can't do that with a RTB.


    Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.

  30. #30
    PowerPoster
    Join Date
    Aug 2011
    Location
    B.C., Canada
    Posts
    2,887

    Re: VB6 -- Disable Scroll Bars in Webbrowser

    Okay in that case it makes sense... but i dont see images in his program on the screenshot anyway.. enough said for now and is solo mero = wiz?
    What is going on here. I think if he wrote that program which i dont think he did. He should know how to remove scrollbars with the solutions we posted or else have to change the webbrowser thing

  31. #31
    Junior Member
    Join Date
    Jan 2012
    Posts
    22

    Re: VB6 -- Disable Scroll Bars in Webbrowser

    who is wiz ? i dont know whom u talking about and about that tool i changed it to rich text box again like it was instead of webbrowse just used webbrowser and tried so remove scroll bar for learning propose also about dis project im working in since 2 months ago man , thannk for your help dude

  32. #32
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: VB6 -- Disable Scroll Bars in Webbrowser

    WIZ started this thread but it appears that you took over it - IDK


    Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.

  33. #33
    PowerPoster
    Join Date
    Aug 2011
    Location
    B.C., Canada
    Posts
    2,887

    Re: VB6 -- Disable Scroll Bars in Webbrowser

    Alright well sorry if you wrote it good work! Hope w helped you a bit good luck with your program

  34. #34
    Junior Member
    Join Date
    Jan 2012
    Posts
    22

    Re: VB6 -- Disable Scroll Bars in Webbrowser

    aha the author im not him i just was googling my inquire and found vbforums and here important notic
    Apr 2nd, 2010, 04:35 <<<<<<<<<<< author wrote that in 2010 did you think im wiz and back to complete my inquire in 2012 :-D lolz

  35. #35
    Junior Member
    Join Date
    Jan 2012
    Posts
    22

    Re: VB6 -- Disable Scroll Bars in Webbrowser

    thank max thank jms brothers :-*

  36. #36
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: VB6 -- Disable Scroll Bars in Webbrowser

    That's why you shouldn't post to an old thread it can get others confused especially me because I don't look at the dates I just look at the contents


    Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.

  37. #37
    PowerPoster
    Join Date
    Aug 2011
    Location
    B.C., Canada
    Posts
    2,887

    Re: VB6 -- Disable Scroll Bars in Webbrowser

    Same here

  38. #38
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: VB6 -- Disable Scroll Bars in Webbrowser

    Quote Originally Posted by solo.mero View Post
    aha the author im not him i just was googling my inquire and found vbforums and here important notic
    Apr 2nd, 2010, 04:35 <<<<<<<<<<< author wrote that in 2010 did you think im wiz and back to complete my inquire in 2012 :-D lolz
    It possible that someone will do that using a different ID but that's not what I thought in this case; I just thought you took over the thread and wiz disappeared for some mysterious reason


    Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.

  39. #39
    Junior Member
    Join Date
    Jan 2012
    Posts
    22

    Re: VB6 -- Disable Scroll Bars in Webbrowser

    that was not for you jms that was for max

  40. #40
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: VB6 -- Disable Scroll Bars in Webbrowser

    @solo.mero

    When you direct a post to any person in particular you should use the @name.
    Last edited by jmsrickland; Jul 2nd, 2012 at 02:21 PM.


    Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.

Page 1 of 2 12 LastLast

Tags for this Thread

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