Navigation:  Getting Started with TextDynamic > TextDynamic dotNET Sample Projects > VB.NET - Create MDI Application > Add Font/-Size Selector >

Modify Text

Previous pageReturn to chapter overviewNext page

Update font name in editor

 

  Private Sub FontNameSel_DropDownClosed(ByVal sender As System.Object,

               ByVal e As System.EventArgs) Handles FontNameSel.DropDownClosed

      If Not WpdllInt1 Is Nothing Then

       WpdllInt1.TextAttr.SetFontface(FontNameSel.Text)

       WpdllInt1.Focus()

      End If

  End Sub

 

Update font size in editor

 

    Private Sub FontSizeSel_Update(ByVal AndFocus As Boolean)

      If Not WpdllInt1 Is Nothing Then

          Try

       WpdllInt1.TextAttr.SetFontSize(Convert.ToSingle(FontSizeSel.Text))

       If AndFocus Then

               WpdllInt1.Focus()

       End If

       Catch ex As Exception

       End Try

      End If

  End Sub

 

  Private Sub FontSizeSel_TextChanged(ByVal sender As System.Object,

       ByVal e As System.EventArgs) Handles FontSizeSel.TextChanged

       FontSizeSel_Update(True)

  End Sub

 

  ' Update the size if user presses CR in combobox

  Private Sub FontSizeSel_KeyPress(ByVal sender As System.Object,

               ByVal e As System.Windows.Forms.KeyPressEventArgs)

               Handles FontSizeSel.KeyPress

      If e.KeyChar = Convert.ToChar(13) Then

           FontSizeSel_Update(False)

      End If

  End Sub