In Vulcan usavo il controllo Webbrowser come editor HTML con questo codice nel CONSTRUCTOR della pagina:
SELF:oWebBrowser1:PreviewKeyDown += System.Windows.Forms.PreviewKeyDownEventHandler{ SELF , @WebBrowser1PreviewKeyDown() }
SELF:oWebBrowser1:AllowNavigation := FALSE
SELF:oWebBrowser1:AllowWebBrowserDrop := FALSE
SELF:oWebBrowser1:ScriptErrorsSuppressed := TRUE
SELF:oWebBrowser1:DocumentText := "<html><body></body></html>"
IVarPut(SELF:oWebBrowser1:Document:DomDocument,#DesignMode,"On")
SELF:oWebBrowser1:Document:ExecCommand("fontSize", FALSE,3)
Ora la funzione ivarput non funziona
Descrizione: No exported variable
Funzione : XSharp.RT
Oggetto : IVarPut
Stack :
in XSharp.RT.OOPHelpers.IVarPut(Object oObject, String cIVar, Object oValue, Boolean lSelf)
in XSharp.RT.Functions.IVarPut(Object o, String cIVar, __Usual uValue)
in WSendMail..ctor()
Qualche idea?
Danilo
WebBrowser editabile
Moderator: wriedmann
WebBrowser editabile
Hi Danilo, in which line of code does the error happen?
Chris Pyrgas
XSharp Development Team
chris(at)xsharp.eu
XSharp Development Team
chris(at)xsharp.eu
- softdevo@tiscali.it
- Posts: 191
- Joined: Wed Sep 30, 2015 1:30 pm
WebBrowser editabile
AT line:
IVarPut(SELF:oWebBrowser1:Document:DomDocument,#DesignMode,"On")
Danilo
IVarPut(SELF:oWebBrowser1:Document:DomDocument,#DesignMode,"On")
Danilo
WebBrowser editabile
Oops, sorry, I did not see this line before. Has the Document object been created, before you try to access it? I think you need to open a page first. Please do a
? SELF:oWebBrowser1:Document:DomDocument:GetType():ToString()
before you use the IVarPut(), what type does it return?
Chris
? SELF:oWebBrowser1:Document:DomDocument:GetType():ToString()
before you use the IVarPut(), what type does it return?
Chris
Chris Pyrgas
XSharp Development Team
chris(at)xsharp.eu
XSharp Development Team
chris(at)xsharp.eu
WebBrowser editabile
Danilo,
as Chris said:
>Has the Document object been created, before you try to access it?
I think you have to change the DesignMode into the Event: DocumentCompleted:
PRIVATE WebBrowser AS System.Windows.Forms.WebBrowser
SELF:WebBrowser := System.Windows.Forms.WebBrowser{}
...
SELF:WebBrowser:DocumentCompleted += System.Windows.Forms.WebBrowserDocumentCompletedEventHandler{ SELF, @WebBrowser_DocumentCompleted() }
...
PRIVATE METHOD WebBrowser_DocumentCompleted( sender AS System.Object, e AS System.Windows.Forms.WebBrowserDocumentCompletedEventArgs ) AS System.Void
SELF:WebBrowser:Document:ExecCommand("EditMode", True, NULL)
RETURN
or someting similar.
regards
George
as Chris said:
>Has the Document object been created, before you try to access it?
I think you have to change the DesignMode into the Event: DocumentCompleted:
PRIVATE WebBrowser AS System.Windows.Forms.WebBrowser
SELF:WebBrowser := System.Windows.Forms.WebBrowser{}
...
SELF:WebBrowser:DocumentCompleted += System.Windows.Forms.WebBrowserDocumentCompletedEventHandler{ SELF, @WebBrowser_DocumentCompleted() }
...
PRIVATE METHOD WebBrowser_DocumentCompleted( sender AS System.Object, e AS System.Windows.Forms.WebBrowserDocumentCompletedEventArgs ) AS System.Void
SELF:WebBrowser:Document:ExecCommand("EditMode", True, NULL)
RETURN
or someting similar.
regards
George
- softdevo@tiscali.it
- Posts: 191
- Joined: Wed Sep 30, 2015 1:30 pm
WebBrowser editabile
Before calling ivarput I initialize the document:
SELF:oWebBrowser1:DocumentText := "<html><body></body></html>"
and I have the method:
METHOD WebBrowser1DocumentCompleted(sender AS System.Object , e AS System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) AS System.Void
LOCAL oType AS Type
LOCAL oPropertyInfo AS System.Reflection.PropertyInfo
LOCAL oWB := (WebBrowser)sender AS WebBrowser
oType :=oWB:Document:DomDocument:GetType()
oPropertyInfo := oType:GetProperty("designMode") // is null
oPropertyInfo:SetValue(oWB:Document:DomDocument, "On", NULL)
RETURN
SELF:oWebBrowser1:DocumentText := "<html><body></body></html>"
and I have the method:
METHOD WebBrowser1DocumentCompleted(sender AS System.Object , e AS System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) AS System.Void
LOCAL oType AS Type
LOCAL oPropertyInfo AS System.Reflection.PropertyInfo
LOCAL oWB := (WebBrowser)sender AS WebBrowser
oType :=oWB:Document:DomDocument:GetType()
oPropertyInfo := oType:GetProperty("designMode") // is null
oPropertyInfo:SetValue(oWB:Document:DomDocument, "On", NULL)
RETURN
WebBrowser editabile
Ciao Danilo,
with the Vulcan runtime it worked and with the X# runtime not anymore?
(scrivo in inglese che anche gli altri non hanno bisogno di traduttori).
Saluti
Wolfgang
with the Vulcan runtime it worked and with the X# runtime not anymore?
(scrivo in inglese che anche gli altri non hanno bisogno di traduttori).
Saluti
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
- softdevo@tiscali.it
- Posts: 191
- Joined: Wed Sep 30, 2015 1:30 pm
WebBrowser editabile
The problem is solved
Danilo
SELF:oWebBrowser1:AllowNavigation := FALSE
SELF:oWebBrowser1:AllowWebBrowserDrop := FALSE
SELF:oWebBrowser1:ScriptErrorsSuppressed := TRUE
SELF:oWebBrowser1:DocumentText := "<html><body></body></html>"
SELF:oWebBrowser1:Document:ExecCommand("EditMode",TRUE,NIL)
SELF:oWebBrowser1:Document:ExecCommand("fontSize",FALSE,3)
Danilo
SELF:oWebBrowser1:AllowNavigation := FALSE
SELF:oWebBrowser1:AllowWebBrowserDrop := FALSE
SELF:oWebBrowser1:ScriptErrorsSuppressed := TRUE
SELF:oWebBrowser1:DocumentText := "<html><body></body></html>"
SELF:oWebBrowser1:Document:ExecCommand("EditMode",TRUE,NIL)
SELF:oWebBrowser1:Document:ExecCommand("fontSize",FALSE,3)