Click here to Skip to main content
15,898,981 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Internet transfer control Pin
JR21217-Oct-11 18:36
JR21217-Oct-11 18:36 
GeneralRe: Internet transfer control Pin
Tom Deketelaere20-Oct-11 1:37
professionalTom Deketelaere20-Oct-11 1:37 
AnswerRe: Internet transfer control Pin
ChandraRam17-Oct-11 3:37
ChandraRam17-Oct-11 3:37 
QuestionInternet transfer control Pin
Magesa14-Oct-11 5:56
Magesa14-Oct-11 5:56 
AnswerRe: Internet transfer control Pin
Wayne Gaylard14-Oct-11 6:00
professionalWayne Gaylard14-Oct-11 6:00 
GeneralRe: Internet transfer control Pin
Magesa15-Oct-11 1:13
Magesa15-Oct-11 1:13 
AnswerRe: Internet transfer control Pin
Simon_Whale14-Oct-11 6:12
Simon_Whale14-Oct-11 6:12 
QuestionPrivateFontCollection not working Pin
JR21214-Oct-11 2:57
JR21214-Oct-11 2:57 
Hi,

I have created a small test program for using a non installed font.
There are only 2 control on the form a right docked printpreviewcontrol and a textbox.

When I use it on the form it prints fine, however on the printpreview its a standaard font and not the ttf file.

What do I wrong??

Jan

VB
Private Sub PrintDocument1_PrintPage(sender As System.Object, e As System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage
  sPrint(e.Graphics)
End Sub

Private Sub fFontTest_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
  TextBox1.Text = "abcdefghijklmnopqrstuvwxyz" & vbCrLf & "abcdefghijklmnopqrstuvwxyz".ToUpper & vbCrLf & "0123456789"
End Sub

Private Sub TextBox1_TextChanged(sender As System.Object, e As System.EventArgs) Handles TextBox1.TextChanged
  PrintPreviewControl1.InvalidatePreview()
End Sub

Private Sub fFontTest_Paint(sender As Object, e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint
  sPrint(e.Graphics)
End Sub
Sub sPrint(g As Graphics)
  Dim pfc As New Drawing.Text.PrivateFontCollection

  pfc.AddFontFile(Application.StartupPath & "\Alpha.ttf")
  Dim ff As FontFamily = pfc.Families(0)
  Dim f As Font = New Font(ff, 20)

  g.DrawString(TextBox1.Text, f, Brushes.Black, 0, 250)
  g.DrawString(f.Name, Me.Font, Brushes.Black, 0, 450)
End Sub

QuestionVB6 not working on older Windows when creating exe from Windows 7 64 bit - scrrun error Pin
Beiteltjie11-Oct-11 23:40
Beiteltjie11-Oct-11 23:40 
AnswerRe: VB6 not working on older Windows when creating exe from Windows 7 64 bit - scrrun error Pin
Dave Kreskowiak12-Oct-11 1:42
mveDave Kreskowiak12-Oct-11 1:42 
QuestionRe: VB6 not working on older Windows when creating exe from Windows 7 64 bit - scrrun error Pin
Luc Pattyn12-Oct-11 9:42
sitebuilderLuc Pattyn12-Oct-11 9:42 
AnswerRe: VB6 not working on older Windows when creating exe from Windows 7 64 bit - scrrun error Pin
Dave Kreskowiak13-Oct-11 9:16
mveDave Kreskowiak13-Oct-11 9:16 
GeneralRe: VB6 not working on older Windows when creating exe from Windows 7 64 bit - scrrun error Pin
Eddy Vluggen13-Oct-11 9:23
professionalEddy Vluggen13-Oct-11 9:23 
GeneralRe: VB6 not working on older Windows when creating exe from Windows 7 64 bit - scrrun error Pin
Dave Kreskowiak13-Oct-11 10:37
mveDave Kreskowiak13-Oct-11 10:37 
GeneralRe: VB6 not working on older Windows when creating exe from Windows 7 64 bit - scrrun error Pin
Eddy Vluggen13-Oct-11 10:39
professionalEddy Vluggen13-Oct-11 10:39 
QuestionReferencing a dll Pin
Sonhospa11-Oct-11 5:49
Sonhospa11-Oct-11 5:49 
AnswerRe: Referencing a dll Pin
Luc Pattyn11-Oct-11 6:12
sitebuilderLuc Pattyn11-Oct-11 6:12 
QuestionRe: Referencing a dll Pin
Sonhospa11-Oct-11 6:55
Sonhospa11-Oct-11 6:55 
AnswerRe: Referencing a dll Pin
ekolis11-Oct-11 7:24
ekolis11-Oct-11 7:24 
GeneralRe: Referencing a dll Pin
Sonhospa11-Oct-11 7:53
Sonhospa11-Oct-11 7:53 
AnswerRe: Referencing a dll Pin
Luc Pattyn11-Oct-11 8:23
sitebuilderLuc Pattyn11-Oct-11 8:23 
NewsReally helpful! (Re: Referencing a dll ) Pin
Sonhospa11-Oct-11 9:17
Sonhospa11-Oct-11 9:17 
AnswerRe: Really helpful! (Re: Referencing a dll ) Pin
Luc Pattyn11-Oct-11 9:39
sitebuilderLuc Pattyn11-Oct-11 9:39 
AnswerRe: Referencing a dll Pin
biop.codeproject13-Nov-11 17:15
biop.codeproject13-Nov-11 17:15 
QuestionFunny FileNotFoundException Pin
Sonhospa10-Oct-11 21:31
Sonhospa10-Oct-11 21:31 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.