Hey Guyz !!!! Wanted ur help !!!
How can I disable the scroll bars in a webbrowser ??
Thnx fr ur help in advance !!!!
Printable View
Hey Guyz !!!! Wanted ur help !!!
How can I disable the scroll bars in a webbrowser ??
Thnx fr ur help in advance !!!!
Check this: http://www.vbforums.com/showthread.p...bar+webbrowser ..:wave:
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 !?
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
And this in Form_Load or somethingCode: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
Code:Call EnableScrollBar(WebBrowser1.hWnd, SB_BOTH, ESB_DISABLE_BOTH)
The constants part is in Red..........!!!
N please find the file attached !!!!!
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.
I face the same problem :p
dr the big when i downloaded ind tried to run it i got an error msg method hwnd of object iwebbrowser2 failed
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
but the attachment file of dr big used like that
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
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
1) Type a lot of text into the text box so that both scroll bars showCode: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
2) Click Command1 and see the bars disabled.
3) Type some more text and you will see the bars re-appear
but i need it for webbrowser brother!
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
ok im waiting
is it for a website or to load pictures?
try this guys :)
Can't get any simpler than that
wont work on ALL websites tho... try this websites... BEWARE ;) ... yes it was simple haha... i just coudln't remember
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.
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!
its still working :-(
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?
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
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.
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.
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
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
WIZ started this thread but it appears that you took over it - IDK
Alright well sorry if you wrote it good work! Hope w helped you a bit good luck with your program
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
thank max thank jms brothers :-*
That's why you shouldn't post to an old thread it can get others confused :confused: especially me:confused: because I don't look at the dates I just look at the contents
Same here :p
that was not for you jms that was for max
@solo.mero
When you direct a post to any person in particular you should use the @name.