New Project

[Top]  [Chapter]  [Previous]  [Next]

 

The source of this project can be downloaded at http://www.wpcubed.com/tdex/vbnetprj1.zip

We will add further functionality in the future (menus, translation). Suggestions are welcome!

 

In VisualStudio 2005 we create a new project with a MDI parent form and a regular form.

 

clip0137

 

The IDE will create a template for us -  we only need to update the code to use our new child form instead of simply creating a generic form.

 

  Private Sub ShowNewForm(ByVal sender As Object, ByVal e As EventArgs) Handles        NewToolStripMenuItem.Click, NewToolStripButton.Click, NewWindowToolStripMenuItem.Click

      ' Create instance

      Dim ChildForm As New WordsChildForm1

      ' assign parent

       ChildForm.MdiParent = Me

 

       m_ChildFormNumber += 1

       ChildForm.Text = "TextDynamic Window " & m_ChildFormNumber

 

       ChildForm.Show()

  End Sub

 

We do not want to discuss the other required changes since the focus of this chapter is how a toolbar can be created and updated and how to work with the menus.

 

Call SetDLLName

 

You can place the code which calls SetDLLName inside the method TForm.New(). The demo does not require this call but if you distribute an application you will need to set a path. In a MDI application it is best to call this static method from the main form code.

 

  Public Sub New()

      ' Additional Code - look for DLL in same directory as EXE (bin directory)

       Me.WpdllInt1.SetDLLName(Application.StartupPath & "\WPTextDLL01.DLL")

      ' For Windows Form-Designer

       InitializeComponent()

  End Sub

 

Call EditorStart

 

WpdllInt1.EditorStart("licensename", "licensekey") has to be called for each editor in the project

 

Set License

 

Please call EditorStart for each TextDynamic editor you use (in Child Form).


[vbnet.htm]    Copyright © 2007 by WPCubed GmbH