privatefontcollection
privatefontcollection
privatefontcollection
privatefontcollection
privatefontcollection
privatefontcollection privatefontcollection privatefontcollection privatefontcollection privatefontcollection privatefontcollection privatefontcollection privatefontcollection
privatefontcollection privatefontcollection
privatefontcollection
Go Back  Xtreme Visual Basic Talk > > > privatefontcollection


Reply
 
Thread Tools Display Modes
  #1  
Old 04-05-2006, 07:45 AM
-boogie -boogie is offline
Newcomer
 
Join Date: Apr 2006
Posts: 1
Default privatefontcollection


I'm trying to get a font in the PrivateFontCollection with the code below, but I keep getting a error on line 3 (filename is already declared as a parameter of this object)
I'm not just a newbie I'm a babybie so i copy-pasted the code from the folowing url. I'm sure it wil be something simple, but I can't find it.

Anyway, here is is,
Code:
    Public Sub AddFontFile(ByVal filename As String)

        Dim instance As System.Drawing.Text.PrivateFontCollection
        Dim filename As String

        instance.AddFontFile(filename)

    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, _
        ByVal e As System.EventArgs) Handles Button1.Click

        Dim f As System.Drawing.Text.PrivateFontCollection = New _
            System.Drawing.Text.PrivateFontCollection
        Dim fFamily As FontFamily

        AddFontFile("c:\arial.ttf")

        For Each fFamily In f.Families
            ComboBox1.Items.Add(fFamily.Name)
        Next

    End Sub
Help?!
Reply With Quote
  #2  
Old 04-05-2006, 08:22 AM
shaul_ahuvaprivatefontcollection shaul_ahuva is offline
Ultimate Contributor

Retired Leader
* Expert *
 
Join Date: Jul 2003
Location: Camp Hill, PA
Posts: 1,992
Default

You can't have a parameter and a variable named the same thing - if you were able to you wouldn't be able to tell which one should be used at any given moment.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
privatefontcollection
privatefontcollection
privatefontcollection privatefontcollection
privatefontcollection
privatefontcollection
privatefontcollection privatefontcollection privatefontcollection privatefontcollection privatefontcollection privatefontcollection privatefontcollection
privatefontcollection
privatefontcollection
 
privatefontcollection
privatefontcollection
 
-->