iNET Interactive - Online Advertising Agency
          
Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > Interface and Graphics > CommandButton to Scroll Up/Down


Reply
 
Thread Tools Display Modes
  #1  
Old 09-15-2003, 07:38 AM
DouBl3K DouBl3K is offline
Newcomer
 
Join Date: Sep 2003
Posts: 9
Default CommandButton to Scroll Up/Down

I need to create a CommandButton to Scroll Down in my WebBrowser Form, but i've no idea how to solve this.
Can someone help me?
Reply With Quote
  #2  
Old 09-15-2003, 07:21 PM
GavinO's Avatar
GavinO GavinO is offline
Coder of Fortune
Retired Leader
* Expert *
 
Join Date: Dec 2002
Location: Troy, NY USA
Posts: 3,120
Default

Well, how do you scroll now? If its a scrollbar, just have the command button adjust the Value property of the scrollbar. If its a scrollbar internal to a webbrowser control, it will be a bit more complicated. Some specifics, please.
__________________
-- The Gavster
Like to IRC? Try irc.randomirc.com
GavServer
Reply With Quote
  #3  
Old 09-16-2003, 12:10 AM
DouBl3K DouBl3K is offline
Newcomer
 
Join Date: Sep 2003
Posts: 9
Default

i create my own webbrowser, it will be used on a touchscreen, so i need 2 Buttons for scroll up/down ... atm the scrollbar isn't active, all html and php files are optimized for 1024 x 768 and my webbrowser too. But when I open a pdf file I need to scroll. I don't know if its a scrollbar internal to a webbrowser control ... I'm new in programming with vb, i think it's the normal scrollbar of the webbrowser control.

thx 4 helping
Reply With Quote
  #4  
Old 09-16-2003, 09:13 AM
GavinO's Avatar
GavinO GavinO is offline
Coder of Fortune
Retired Leader
* Expert *
 
Join Date: Dec 2002
Location: Troy, NY USA
Posts: 3,120
Default

So, there is already a scrollbar in the browser? Then your touchscreen should be able to use that scrollbar. A stock control should be fully equipped to scroll if necessary. Specifically, are you using the WebBrowser control, or something else?
__________________
-- The Gavster
Like to IRC? Try irc.randomirc.com
GavServer
Reply With Quote
  #5  
Old 09-17-2003, 12:09 AM
DouBl3K DouBl3K is offline
Newcomer
 
Join Date: Sep 2003
Posts: 9
Default

Yeah there is an auto scrollbar and I use the Webbrowser Control. But the Problem is, that the normal scrollbar is very small to touch with a finger, i think. So i want to put this control in a bigger button ...

I hope u can help me
Reply With Quote
  #6  
Old 09-17-2003, 10:28 AM
GavinO's Avatar
GavinO GavinO is offline
Coder of Fortune
Retired Leader
* Expert *
 
Join Date: Dec 2002
Location: Troy, NY USA
Posts: 3,120
Default

There are accesiblity settings within windows that will allow you make all UI elements easier to manipulate with the touchscreen. Specificlly, I think you want scrollbar width and titlebar width under control panel->display->appearance. This should be much easier than digging into the webbrowser control to adjust the scrollbars. If you need to change the settings programatically, I think you can do so through registry manipulation.
__________________
-- The Gavster
Like to IRC? Try irc.randomirc.com
GavServer
Reply With Quote
  #7  
Old 09-17-2003, 11:17 AM
Aspen2K's Avatar
Aspen2K Aspen2K is offline
Contributor
Retired Leader
* Expert *
 
Join Date: Jan 2001
Location: Ohio
Posts: 717
Default

If you find the x and y position of the top and botton of the scrollbar I bet you could use:
Code:
Private Declare Function SetCursorPos Lib "user32" (ByVal X As Long, ByVal Y As Long) As Long Private Declare Sub mouse_event Lib "user32" (ByVal dwFlags As Long, ByVal dx As Long, ByVal dy As Long, ByVal cButtons As Long, ByVal dwExtraInfo As Long) Private Const MOUSEEVENTF_LEFTDOWN = &H2 ' left button down ' Moves mouse... SetCursorPos X, Y mouse_event MOUSEEVENTF_LEFTDOWN, X, Y, 0, 0
Just a thought,
Aspen2K
__________________
A man is a success if he gets up in the morning and gets to bed at night,
and in between does what he wants to do. - Bob Dylan

Vb code does not go through spell check very well - Me
Reply With Quote
  #8  
Old 09-18-2003, 12:43 AM
DouBl3K DouBl3K is offline
Newcomer
 
Join Date: Sep 2003
Posts: 9
Default

@Aspen2k
When I paste your code in my project I get compilation errors

@GavinO
Where can I change the width of the scrollbar, when I set
Const vbBoth = 6 nothing changed ...
Reply With Quote
  #9  
Old 09-18-2003, 08:02 AM
GavinO's Avatar
GavinO GavinO is offline
Coder of Fortune
Retired Leader
* Expert *
 
Join Date: Dec 2002
Location: Troy, NY USA
Posts: 3,120
Default

The little kludge of changing display settings will work pretty much only if you are running this on one machine or multiple identical machines off of a Ghost image (or if you have a masochistic level of dedication ) Pretty much, you go into the Windows display properties and bump up the default scrollbar width. It isn't a VB solution, unfortunately. For that, Aspen2K's solution is far more elegant.
__________________
-- The Gavster
Like to IRC? Try irc.randomirc.com
GavServer
Reply With Quote
  #10  
Old 09-19-2003, 12:26 AM
DouBl3K DouBl3K is offline
Newcomer
 
Join Date: Sep 2003
Posts: 9
Default

thx, but when I past Aspen's code i get compilation errors ... can u explain it?
Reply With Quote
  #11  
Old 09-22-2003, 11:23 AM
SGR SGR is offline
Newcomer
 
Join Date: Sep 2003
Posts: 2
Wink Here you am....

Hey, dont be complicated!

use the following in your button

webbrowser1.Document.body.doscroll("down")

works with "left" "right" and "up" also...

I leave in Argentina please send me money, i ll die en 1 week if i do not eat !!!
Reply With Quote
  #12  
Old 09-22-2003, 02:33 PM
Aspen2K's Avatar
Aspen2K Aspen2K is offline
Contributor
Retired Leader
* Expert *
 
Join Date: Jan 2001
Location: Ohio
Posts: 717
Default

SGR, you are the man ! I knew there would be a WB solution !

* Aspen2K Bows down and praises SGR

Aspen2K
__________________
A man is a success if he gets up in the morning and gets to bed at night,
and in between does what he wants to do. - Bob Dylan

Vb code does not go through spell check very well - Me
Reply With Quote
  #13  
Old 09-23-2003, 12:56 AM
DouBl3K DouBl3K is offline
Newcomer
 
Join Date: Sep 2003
Posts: 9
Default

thx 4 ur help

But when I open a pdf file, i can't scroll again ... but this is important.
How can I scroll through a pdf file with these buttons?

Last edited by DouBl3K : 09-23-2003 at 05:29 AM.
Reply With Quote
  #14  
Old 09-25-2003, 01:23 PM
SGR SGR is offline
Newcomer
 
Join Date: Sep 2003
Posts: 2
Exclamation I just...

I just trying to determine why it cant scroll down in a pdf.

I think that the pdf is "contained" in te webbrowser control, the doscroll method doesnt apply to the pdf, have you test in .doc or another document type if is the same?,

currently i don't see any way to scroll the pdf. Have you tried to make a page in html to frame pdfs and test if it works? i think it only scrolls the not visible part of the pdf even of the pdf itself, but keep a try!

meanwhile i keep testing...
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Scroll scroll scroll let it scroll Aquila Forum Questions / Concerns / Comments 1 09-08-2003 11:32 AM
Disable Mouse Scroll in Sub Form nickg96 Database and Reporting 16 10-04-2002 11:12 AM
scroll bar and the mouse wheel sarge General 1 10-01-2002 09:21 AM
Making a vertical scroll bar scroll!! sadcaper General 4 05-28-2002 02:07 PM
Datagrid scroll problem Higgins General 0 03-02-2002 03:23 PM

Advertisement: