Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Qm3 How to add the Winform controls
#1
Hi,

I've seen several examples of WPF on forums

I want to know how to add the Winform controls and show the form in QM3?

For example, the following C# code describes, how to implement?

Thanks in advance for any advice and help
david
-----------------------------------------------------------------------------------------------------------------------------------------
1.Create a new Windows Forms project;
2.Add reference to EO.WebBrowser.dll. Note that you do not need to reference EO.WebBrowser.Wpf.dll;
3.Open Form "Form1" in design view;
4.Drag a PictureBox control onto the form;
5.From solution explorer, right click "Form1.cs" if you use C#, then click "View Code" from the context menu;
6.Add the following code to class Form1 to declare a WebView variable:

//Declare a new WebView object
private EO.WebBrowser.WebView m_WebView = new EO.WebBrowser.WebView();

7.Handle the Form's Load event and add the following code to initialize the WebView:

private void Form1_Load(object sender, EventArgs e)
{
    //Initialize the WebView using the PictureBox's window handle
    m_WebView.Create(pictureBox1.Handle);
    
    //Load Google's home page into the WebView
    m_WebView.Url = "www.quickmacros.com";
}
-----------------------------------------------------------------------------------------------------------------------------------------

C# code:
// script "WebView_OE.cs" /*/ role exeProgram; outputPath %folders.Workspace%\exe\WebView_OE; r %dll%\EO\EO.WebBrowser.dll; r %dll%\EO\EO.WebBrowser.WinForm.dll; /*/

private EO.WebBrowser.WebView WebView1 = new EO.WebBrowser.WebView();

//Todo: Add controls

private void Form1_Load(object sender, EventArgs e)
{
    //Initialize the WebView using the PictureBox's window handle
    m_WebView.Create(pictureBox1.Handle);
    
    //Load Google's home page into the WebView
    m_WebView.Url = "www.quickmacros.com";
}


Messages In This Thread
Qm3 How to add the Winform controls - by Davider - 08-16-2022, 02:29 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)