Here I have such a situation, I am "flipping through" links in the component window by simulating pressing the Tab key. Having reached the link I need, a transition should be made by imitating pressing the enter key. However - nothing happens. And it is very necessary to force the program to follow the link.

Also regarding the scrolling of the same component. Can it be scrolled programmatically? And how can you adjust the scale of the page in the component?

  • @ Avada Kedavra; Check what language. Also explain the conditions in which the application should work. - Nicolas Chabanovsky ♦
  • Delphi (pascal). Here's what I want: we go programmatically to the site. The program simulates say 6-fold pressing tab. We fall on the necessary link. The task is to go through it programmatically. The options are as follows: either hover the mouse over the highlighted link, then press it programmatically, or press unter programmatically. But in the component, the latter does not work, unlike the usual browser, for example, Mozili. Here is such a problem! - Avada Kedavra
  • I understand that for local programmers it turned out to be impossible to solve a similar puzzle ... Gee .. weakly .. immediately transferred to closed and forgotten! Well done! I propose to call the site - help newcomers from beginners! Good luck! - Avada Kedavra
  • @ Avada Kedavra, and you all the best. - VioLet pm

1 answer 1

the scale is quite simple

 WebBrowser1.OleObject.Document.Body.Style.Zoom:= число; //Π½Π°ΠΏΡ€ΠΈΠΌΠ΅Ρ€, 0.75 - 75%, 3-300%, ΠΈ Ρ‚.Π΄ 

scrolling is as follows:

 WebBrowser1.OleObject.Document.ParentWindow.ScrollBy(x, y);//Π½Π°ΠΏΡ€ΠΈΠΌΠ΅Ρ€, (0,100)-ΠΏΡ€ΠΎΠΊΡ€ΡƒΡ‚ΠΊΠ° Π²Π½ΠΈΠ· Π½Π° 100 пиксСлСй, (-10,0)-ΠΏΡ€ΠΎΠΊΡ€ΡƒΡ‚ΠΊΠ° Π²Π»Π΅Π²ΠΎ Π½Π° 10 пиксСлСй 

You can programmatically press the ENTER key in the WebBrowser component as follows:

 SendMessage(webbrowser1.handle, WM_KEYDOWN,VK_RETURN,0); 
  • Thank you so much! They helped a lot, otherwise I spent a lot of time and did not find anything I needed. Thanks again! Bail out !!! - Avada Kedavra
  • Do not forget to accept the answer :) - ikot