Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 15083

IFont Clone Method

$
0
0
Code:

Private Sub UserForm_Click()
   
    Dim IButton1Font  As stdole.IFont
    Dim IButton2Font  As stdole.IFont
   
    Set IButton1Font = CommandButton1.Font
    Set IButton2Font = CommandButton2.Font
   
    IButton1Font.Name = "Harlow Solid Italic"
   
    IButton1Font.Clone IButton2Font
 
End Sub

I have never used the IFont Clone Method before.

I was expecting the above code snippet would just copy "clone" the new font "Harlow Solid Italic" from CommandButton1 to CommandButton2, but it is not doing so.

The Font of CommandButton1 is changed to ("Harlow Solid Italic") but the Font of CommandButton2 is not.

No error is raised.

Am I doing this correctly ?

Regards.

Viewing all articles
Browse latest Browse all 15083

Trending Articles



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