| Версия для печати темы
Нажмите сюда для просмотра этой темы в оригинальном формате |
| Форум программистов > Delphi: Для новичков > scroll to top and bottom |
| Автор: muratboy31 10.2.2010, 10:08 | ||
i want to autoscroll the web page from top to bottom and then bottom to top, i can do scrolling with timer but i dont know how to do it to scroll top when it is at the bottom ??
|
| Автор: Mikel 10.2.2010, 11:20 | ||
|
| Автор: muratboy31 10.2.2010, 12:08 |
| yes yes it works but i want to do it automaticly... when the scroller is at the bottom then it should scroll to top and when it is at the top then scroll to bottom automaticly... i hope you understand what i mean... |
| Автор: Mikel 11.2.2010, 15:16 | ||
|
| Автор: muratboy31 11.2.2010, 15:37 | ||
| thanks alot Mikel i used it with spin edit it works perfect apart from 1 thing... how can i stop user type . or , in spin edit becuase it gives error if there is . or , in spin edit...
|
| Автор: Mikel 11.2.2010, 15:47 |
| You should convert SpinEdit1.Text to number with val procedure and not use SpinEdit1.Value. Another variant- use try...except...end construction to catch exceptions. |
| Автор: muratboy31 11.2.2010, 15:51 |
| ok i will do that Mikel... do you think it will work with pages that has frames ? because i tried one and it didnt scroll it... you can also tyr it... here is the web site; http://www.canliskor.com/ |
| Автор: Mikel 11.2.2010, 16:13 |
| May be, because ScrollTo doesn't influe on WB1.OleObject.Document.Body.ScrollTop, which is always equal to 0. Look for info about TWebbrowser and Document interface |
| Автор: muratboy31 11.2.2010, 16:16 |
| i cant open the page !!! http://www.bsalsa.com/ewb_propert.html |
| Автор: muratboy31 11.2.2010, 16:41 | ||
i tried like that but i got error says;![]()
|
| Автор: Mikel 11.2.2010, 17:38 |
| It's seems that this will help you http://www.rudins.ru/technoshop/lyceum/polosy_prokrutki/ |
| Автор: muratboy31 11.2.2010, 18:15 | ||
| thanks for reply Mikel but do i have create the scroll bar !!! it is all russian and if i tranlate it to english then it becomes something strange and really difficult to understand... can i not just use a code from the page taht will take me there ! because i couldnt find this;
|
| Автор: muratboy31 11.2.2010, 19:46 |
| ok i found how to scroll down and up, but i need to combine it so when it is at the bottom scroll top and if it is on top then scroll bottom... |
| Автор: Mikel 12.2.2010, 09:21 |
| There is a loop, where we search element for scrolling. Find it in DownloadComplete event, and then you may scroll it. volvo877, wrote example for you with test for end of page. |
| Автор: muratboy31 12.2.2010, 09:54 | ||
| thanks for helps it works perfect but i didnt understand wht it doesnt work good if i use the timer with spin value !!!
|
| Автор: volvo877 12.2.2010, 10:15 | ||
In this case you should change the code:
|
| Автор: muratboy31 12.2.2010, 10:25 | ||
| thanks volvo but what does it mean ; expression expected but then found
|
| Автор: volvo877 12.2.2010, 10:34 |
| No-no-no... Do you see the space between If and Then in my post? |
| Автор: muratboy31 12.2.2010, 10:36 |
| yes yes i also tried it but it said undeclared identifier 'ifthen' ... |
| Автор: volvo877 12.2.2010, 10:43 | ||||
Update:
|
| Автор: muratboy31 12.2.2010, 10:58 |
| but if i type a number to spinedit then it crashes and also it doesnt start scrooling if i dont spin a number up or down... i used checkedbox to start scrolling but it doesnt start scrolling when i check it, it starts only if i spin a number... |
| Автор: volvo877 12.2.2010, 11:04 |
| D2009 on WinXP. My code works perfectly (no crash, and scroll starts as I type in spinbox). I think something wrong in OTHER parts of your project. |
| Автор: muratboy31 12.2.2010, 11:33 |
| i use delphi 7 on win xp and it just doesnt work on design time, if i compile it it works fine... thanks volvo i could never do it on my own... |