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.........
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
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.........
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
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 !!!!!
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.........
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.
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.........
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...
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.
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.
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.
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
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.
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.
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.
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!
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
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.
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.
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.
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
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.
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
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.
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.
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.