scrolling down with a webbrowser control
Posted on 2003-03-11
I'm making a chat program with winsock that outputs messages to the end of an HTML file, which displays in a webbrowser component. I need to tell the webbrowser to scroll down to the bottom of the HTML page every time I receive new data (using the winsock DataArrival event), but I can't access the position of the webbrowser's scroll bar. There doesn't seem to be a property for the webbrowser component that allows me to read/adjust where the scrollbar is set to.
I tried always writing an anchor at the end of the HTML file, and then running webbrowser1.Navigate("pagename.html#anchorname), but then the page just stops refreshing altogether. Is there a way around this problem I haven't thought of?