---
title: "PrivateFontCollection"
type: "forum-thread"
url: "https://www.webforum.nu/amne/dotnet/77262-privatefontcollection"
topic: ".NET"
topic_url: "https://www.webforum.nu/amne/dotnet"
author: "DavidB"
published: "2003-05-17T17:50:10.000Z"
updated: "2003-05-17T20:58:45.000Z"
replies: 1
views: 224
page: 1
pages: 1
language: "sv-SE"
site: "webForum — webforum.nu"
rights: "Upphovsrätten till varje inlägg tillhör dess författare."
attribution: "Citera som: webForum, https://www.webforum.nu/amne/dotnet/77262-privatefontcollection"
---

# PrivateFontCollection

## #1 — DavidB, 2003-05-17T17:50Z

varför fungerar den överska koden (VB) men inte den nedersta (C#)?

```
Dim privateFontCollection As New PrivateFontCollection()
privateFontCollection.AddFontFile(Server.MapPath("BAMBOO.TTF"))
Dim thisFont As FontFamily = privateFontCollection.Families(0)
```

```
PrivateFontCollection pfc = new PrivateFontCollection();
pfc.AddFontFile(Server.MapPath("BAMBOO.TTF"));[red]
FontFamily thisFont = pfc.Families(0);[/red]
```

får följande fel om jag kör den nedersta:
'System.Drawing.Text.FontCollection.Families' denotes a 'property' where a 'method' was expected

Permalänk: https://www.webforum.nu/p/77262

## #2 — renholm, 2003-05-17T20:58Z

Ta bort (0) från families och kör med \[0\] eftersom den retunerar en collection.

Permalänk: https://www.webforum.nu/p/1051810

---

Tråden på webben: https://www.webforum.nu/amne/dotnet/77262-privatefontcollection
