Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Alternatives of old IE methods
#11
Hi,

Today I played a bit with MS Access. Only have a very old version here, but I suspect that that isn't the main issue.
I could not reproduce what you're seeing, but it did behave a bit wacky.

This is the code I ended up with that seems to behave reasonably.
Code:
Option Compare Database
Private WithEvents Document As AntViewAx.AntViewDocument


Private Sub Document_OnRequestCurrentHtml(ByVal Html As String)
  MsgBox Html
End Sub

Private Sub EdgeWebBrowser_OnCreateWebviewCompleted(ByVal HResult As Long)
  If HResult = 0 Then
    Form_Resize
  End If
End Sub


Private Sub Form_Load()
  Set Document = CreateObject("AntViewAx.AntViewDocument")
 
  EdgeWebBrowser.CreateWebView
  EdgeWebBrowser.Navigate "https://docs.microsoft.com/en-us/dotnet/api/microsoft.web.webview2.core"
  EdgeWebBrowser.AutoSize = False
  EdgeWebBrowser.EventsUseHexadecimal = True
End Sub


Private Sub Form_Resize()
  On Error Resume Next
  If EdgeWebBrowser.WebViewCreated = True Then
    EdgeWebBrowser.Width = Me.InsideWidth - 500
    EdgeWebBrowser.Height = Me.InsideHeight - 700 - GetHtmlButton.Height
  End If
End Sub

Private Sub GetHtmlButton_Click()
  Document.CurrentBrowser = Me.EdgeWebBrowser.Object
  Document.RequestCurrentHtml
End Sub
So only resizing after the control has actually been created.
Sending a resize immediately after a create and using InsideWidth and InsideHeight.
Oh and I also had to turn off AutoSize (whatever that does)

I'm setting EventsUseHexadecimal there as that's a setting I expect you will need in order to be able to use several of the events.

Hope this helps,
--
Wil
Reply


Messages In This Thread
Alternatives of old IE methods - by hsacrm - 2022-08-30, 07:34:20
RE: Alternatives of old IE methods - by wila - 2022-08-30, 10:17:06
RE: Alternatives of old IE methods - by Patrickb - 2022-11-03, 20:10:42
RE: Alternatives of old IE methods - by hsacrm - 2022-08-30, 13:05:33
RE: Alternatives of old IE methods - by wila - 2022-08-30, 17:12:07
RE: Alternatives of old IE methods - by hsacrm - 2022-08-31, 07:32:58
RE: Alternatives of old IE methods - by wila - 2022-08-31, 11:02:56
RE: Alternatives of old IE methods - by hsacrm - 2022-09-09, 14:00:43
RE: Alternatives of old IE methods - by wila - 2022-09-10, 17:45:32
RE: Alternatives of old IE methods - by hsacrm - 2022-09-12, 06:39:00
RE: Alternatives of old IE methods - by wila - 2022-09-12, 12:44:00
RE: Alternatives of old IE methods - by wila - 2022-09-13, 22:20:57
RE: Alternatives of old IE methods - by hsacrm - 2022-09-14, 13:01:42
RE: Alternatives of old IE methods - by wila - 2022-09-14, 14:02:43
RE: Alternatives of old IE methods - by wila - 2022-11-03, 21:02:38
RE: Alternatives of old IE methods - by Patrickb - 2022-11-15, 20:12:43
RE: Alternatives of old IE methods - by wila - 2022-11-15, 22:54:47
RE: Alternatives of old IE methods - by Patrickb - 2022-11-16, 15:41:16
RE: Alternatives of old IE methods - by wila - 2022-11-16, 16:08:59

Forum Jump:


Users browsing this thread: 2 Guest(s)