Hallo und Guten Tag,
ich bin neu hier und befinde mich kurz vor dem ersten Lehrjahr zur Fachinformatikerin.
Dami ich nicht ganz so dumm dastehe, werde ich mich vorher schon mal ein wenig in VB2008 einarbeiten.
Ich habe mir die Verweise auf das AxDHTMLEDLib und DHTMLEDLib, also das DHTMLEdit Control for IE5 in ein Testprojekt eingebunden. Hiermit versuche ich HTML-Seiten zu erstellen, was auch prima funktioniert.
Ich setze zum Beispiel die Schriftfarbe eine markierten Texten auf rot, indem ichHtmlEditor.ExecCommand(DHTMLEDLib.DHTMLEDITCMDID.DECMD_SETFORECOLOR, _
DHTMLEDLib.OLECMDEXECOPT.OLECMDEXECOPT_DODEFAULT, "red") ausführe.
Fett mache ich einen markierten Text, indem ichHtmlEditor.ExecCommand(DHTMLEDLib.DHTMLEDITCMDID.DECMD_BOLD) ausführe.
Allerdings stoße ich jetzt auf ein Problem, welches mir den letzten Nerv raubt und das schon seit Tagen und ich komme einfach nicht weiter.
Ich habe 2 ComboBoxen. Eine für Schriftname (ComboBox2) und eine für Schriftgröße (ComboBox1).
Bei Klick auf eine der beiden Comboboxen soll hier zum Beispiel die Schriftgröße des markierten Textes angepasst werden.
Leider komme ich nicht weiter. Hier mal mein Beispiel für die SchriftgrößeHtmlEditor.ExecCommand(DHTMLEDLib.DHTMLEDITCMDID.DECMD_SETFONTSIZE, _
DHTMLEDLib.OLECMDEXECOPT.OLECMDEXECOPT_DODEFAULT, 5) Diese Zeile wird auch sofort markiert, da ich natürlich beim Programmstart dieser Combobox den zweiten Wert zuweise.
Die Meldung lautetSystem.Runtime.InteropServices.COMException wurde nicht behandelt.
ErrorCode=-2147418113
Message="Schwerwiegender Fehler (Ausnahme von HRESULT: 0x8000FFFF (" & _
"E_UNEXPECTED))"
Source="Interop.DHTMLEDLib"
StackTrace:
bei DHTMLEDLib.IDHTMLEdit.ExecCommand(DHTMLEDITCMDID cmdID, _
OLECMDEXECOPT cmdexecopt, Object& pInVar)
bei AxDHTMLEDLib.AxDHTMLEdit.ExecCommand(DHTMLEDITCMDID cmdID, _
OLECMDEXECOPT cmdexecopt, Object& pInVar)
bei Testanwendung.frmMain.ComboBox1_SelectedIndexChanged(Object sender, _
EventArgs e) in _
D:\_Software\___Testanwendung\Testanwendung\frmMain.vb:Zeile 437.
bei System.Windows.Forms.ComboBox.OnSelectedIndexChanged(EventArgs e)
bei System.Windows.Forms.ComboBox.set_SelectedIndex(Int32 value)
bei Testanwendung.frmMain.Form1_Load(Object sender, EventArgs e) in _
D:\_Software\___Testanwendung\Testanwendung\frmMain.vb:Zeile 20.
bei System.EventHandler.Invoke(Object sender, EventArgs e)
bei System.Windows.Forms.Form.OnLoad(EventArgs e)
bei System.Windows.Forms.Form.OnCreateControl()
bei System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
bei System.Windows.Forms.Control.CreateControl()
bei System.Windows.Forms.Control.WmShowWindow(Message& m)
bei System.Windows.Forms.Control.WndProc(Message& m)
bei System.Windows.Forms.ScrollableControl.WndProc(Message& m)
bei System.Windows.Forms.ContainerControl.WndProc(Message& m)
bei System.Windows.Forms.Form.WmShowWindow(Message& m)
bei System.Windows.Forms.Form.WndProc(Message& m)
bei System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& _
m)
bei System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
bei System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, _
Int32 msg, IntPtr wparam, IntPtr lparam)
bei System.Windows.Forms.SafeNativeMethods.ShowWindow(HandleRef hWnd, _
Int32 nCmdShow)
bei System.Windows.Forms.Control.SetVisibleCore(Boolean value)
bei System.Windows.Forms.Form.SetVisibleCore(Boolean value)
bei System.Windows.Forms.Control.set_Visible(Boolean value)
bei System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner( _
Int32 reason, ApplicationContext context)
bei System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 _
reason, ApplicationContext context)
bei System.Windows.Forms.Application.Run(ApplicationContext context)
bei _
Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase._
OnRun()
bei _
Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Do_
ApplicationModel()
bei _
Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Ru_
n(String[] commandLine)
bei Testanwendung.My.MyApplication.Main(String[] Args) in _
17d14f5c-a337-4978-8281-53493378c1071.vb:Zeile 81.
InnerException: |