Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27046

FontDialog showing 2X

$
0
0
I am using the FontDialog and am having a couple problems.

First, I cannot get the apply button to work. I have tries several things but this is the latest incarnation. Whenever I click apply nothing happens.....
Code:

Private Sub fontDlg_Apply(sender As System.Object, e As System.EventArgs)
        lbxName.Font = fontDlg.Font
        lbxContent.Font = fontDlg.Font
        lbxName.ForeColor = fontDlg.Color
        lbxContent.ForeColor = fontDlg.Color
    End Sub

Also, whenever I click on either ok or cancel, then the window pops again. Everything else works properly. I cannot spot anything that would cause this.

Code:

Private Sub tlsCustom_Click(sender As System.Object, e As System.EventArgs) Handles tlsCustom.Click

        fontDlg.ShowColor = True
        fontDlg.ShowApply = True
        fontDlg.ShowEffects = True
        fontDlg.ShowHelp = False
        fontDlg.AllowScriptChange = False
        fontDlg.AllowVectorFonts = False
        fontDlg.MaxSize = 20
        fontDlg.MinSize = 8

        Me.lbxName.ForeColor = lbxName.ForeColor
        Dim strFont As Font = Me.Font
        Dim strColor As String = My.Settings.c4wFontColor.Name

        If (fontDlg.ShowDialog() = DialogResult.OK) Then
            lbxName.Font = fontDlg.Font
            lbxName.ForeColor = fontDlg.Color
            lbxContent.Font = fontDlg.Font
            lbxContent.ForeColor = fontDlg.Color
        End If
        If (fontDlg.ShowDialog() = DialogResult.Cancel) Then
            Exit Sub
        End If
        Dim result As DialogResult = MessageBox.Show("Would you like to keep these changes?", _
            "Please Confirm", _
            MessageBoxButtons.YesNo)

        If result = 6 Then
            My.Settings.c4wFont = fontDlg.Font
            My.Settings.c4wFontColor = fontDlg.Color
            My.Settings.Save()
            Exit Sub
        End If

        If result = 7 Then
            lbxName.Font = strFont
            lbxContent.Font = strFont
            lbxName.ForeColor = System.Drawing.Color.FromName(strColor)
            lbxContent.ForeColor = System.Drawing.Color.FromName(strColor)
            Exit Sub
        End If

    End Sub

Any suggestions will be greatly appreciated.

Jim

Viewing all articles
Browse latest Browse all 27046

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>