Fontdialog code not working: want to change diagram text node

I could not figure out how to use the xp bar and had to go with a tool bar. As such, I could not add the font combobox to the toolbar at design time. I went, therefore, with a button. On the buttons click event, I want to open a fontdialog and have the user choose a font and its size to apply to a text node. I cannot get it to work.

This code not only shows the dialog box twice, but the font and its size is not applied to the text. I don't know where I'm going wrong. I've tried it with several different combinations of code. Please help.

Private Sub btnFontDialog_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnFontDialog.Click
Dim strFamilyName As String = FontDialog1.ShowDialog.ToString
If FontDialog1.ShowDialog() <> DialogResult.Cancel Then
Me.Diagram1.Controller.TextEditor.FamilyName = strFamilyName
End If
End Sub
Thank you.



2 Replies

AD Administrator Syncfusion Team May 1, 2011 02:31 AM UTC

figured it out. Geese. no answers to my questions.



PM Pandi Murugan A Syncfusion Team May 2, 2011 09:39 AM UTC

Hi White,

We are sorry for the delay in getting back to you.

Here is the sample for XPTool bar.

<http://www.syncfusion.com/uploads/redirect.aspx?&team=support&file=ManiFrameBarManager365002270.zip>

Here is how you can populate the menu, Add the items in the Customize dialog and Drag and Drop to the toolbar.
<http://help.syncfusion.com/ug_84/User%20Interface/Windows%20Forms/Tools/default.htm?turl=Documents%2Faddingandfillingthexptoolbar.htm>

Here is the code snippet for changing the TextEditor font name through font dialog.

If FontDialog1.ShowDialog(diagram1) = DialogResult.OK Then
diagram1.Controller.TextEditor.FamilyName = FontDialog1.Font.FontFamily.Name
End If


Please let me know if you have any concerns.

Regards,
Pandi Murugan A




Loader.
Up arrow icon