Results 1 to 40 of 4215

Thread: CommonControls (Replacement of the MS common controls)

Threaded View

  1. #11
    Frenzied Member
    Join Date
    Jan 2010
    Posts
    1,103

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Krool View Post
    I do not think it is a good idea to make a 'New' Font after the dialog was called. Thus it should be kept as the original.
    Instead you should de-reference the passed Font from the Textboxes.

    So Instead of:
    Code:
    Private Sub cmdNewFont_Click()
        Dim otempFont As StdFont, Flags As CdlCFConstants
        Dim FontDialog As KroolCommonDialog
        
        Set otempFont = txtFooter1.Font
    Put like following:
    Code:
    Private Sub cmdNewFont_Click()
        Dim otempFont As StdFont, Flags As CdlCFConstants
        Dim FontDialog As KroolCommonDialog
        
        Set otempFont = New StdFont 'de-reference Font Object
        With otempFont
            .Bold = txtFooter1.FontBold
            .Italic = txtFooter1.FontItalic
            .Underline = txtFooter1.FontUnderline
            .Strikethrough = txtFooter1.FontStrikethru
            .Size = txtFooter1.FontSize
            .Name = txtFooter1.FontName
        End With
    OK. That is fine,I have to write more codes to assign Font. I don't know what the behind story of "Set otempFont = txtFooter1.Font" and "Set txtFooter1.Font = otempFont". This is the simply and logic but bring some strange problem.
    Last edited by Jonney; May 30th, 2014 at 08:26 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width