Click here to Skip to main content
15,897,891 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Passing Text from Vb.net to Ms Word Pin
JR21224-Aug-11 10:00
JR21224-Aug-11 10:00 
GeneralRe: Passing Text from Vb.net to Ms Word Pin
shy boi25-Aug-11 0:07
shy boi25-Aug-11 0:07 
Questionprocess not starting on x64 bit OS Pin
Gagan.2024-Aug-11 5:38
Gagan.2024-Aug-11 5:38 
AnswerRe: process not starting on x64 bit OS Pin
Richard MacCutchan24-Aug-11 6:11
mveRichard MacCutchan24-Aug-11 6:11 
AnswerRe: process not starting on x64 bit OS Pin
Dalek Dave24-Aug-11 23:39
professionalDalek Dave24-Aug-11 23:39 
QuestionForm in SplitContainer Pin
daemonsead200823-Aug-11 22:48
daemonsead200823-Aug-11 22:48 
AnswerRe: Form in SplitContainer Pin
Dave Kreskowiak24-Aug-11 3:40
mveDave Kreskowiak24-Aug-11 3:40 
QuestionFontProblem Pin
JR21223-Aug-11 21:30
JR21223-Aug-11 21:30 


Hi I have a font that I use, but on some PC I can't install it(no rights)
So I wrote a function to use the installed font if it exist or the ttf file
this is the code
Public Function ChessFont(ByVal Grootte As Integer, ByVal style As FontStyle) As Font
  Dim f As Font = Nothing
  If Settings.ChessFont <> "" Then
    f = New Font(Settings.ChessFont, Grootte, style)
  End If
  If (f.Name.ToUpper <> Settings.ChessFont.ToUpper) Then
    If Settings.ChessFontFile <> "" Then
      Dim pfc As New Drawing.Text.PrivateFontCollection
      pfc.AddFontFile(Settings.ChessFontFile)
      Dim ff As FontFamily = pfc.Families(0)
      f = New Font(ff, Grootte, style)
      'just testing
      Dim frm As New Form
      Dim l As New Label
      l.Font = f
      l.Visible = True
      l.Location = New Point(0, 0)
      l.Size = New Size(200, 200)
      l.BackColor = Color.Yellow
      l.Text = "kqrbhp lwtnjo"' these symbols I use
      frm.Controls.Add(l)
      frm.ShowDialog()
      'and works fine
    End If
  End If
  Return f
End Function


On the test form I have the correct result but is U use the font
like
Dim F as Font = ChessFont(16,Bold)
e.graphics.drawstring("Test",F,black,0,0)

it is not working. I have times new roman as font

Can someone point me to what i'm doing wrong?
AnswerRe: FontProblem Pin
Dave Kreskowiak24-Aug-11 3:59
mveDave Kreskowiak24-Aug-11 3:59 
GeneralRe: FontProblem Pin
JR21224-Aug-11 4:54
JR21224-Aug-11 4:54 
GeneralRe: FontProblem Pin
Dave Kreskowiak25-Aug-11 7:03
mveDave Kreskowiak25-Aug-11 7:03 
QuestionMultiple datasource on rdlc in asp.net Pin
C#Coudou23-Aug-11 20:13
C#Coudou23-Aug-11 20:13 
Questiongroup by years Pin
sorin_zan23-Aug-11 7:58
sorin_zan23-Aug-11 7:58 
AnswerRe: group by years Pin
Dave Kreskowiak23-Aug-11 10:48
mveDave Kreskowiak23-Aug-11 10:48 
AnswerRe: group by years Pin
Dalek Dave23-Aug-11 11:21
professionalDalek Dave23-Aug-11 11:21 
AnswerRe: group by years Pin
Shahan Ayyub23-Aug-11 14:09
Shahan Ayyub23-Aug-11 14:09 
AnswerRe: group by years Pin
Luc Pattyn23-Aug-11 16:54
sitebuilderLuc Pattyn23-Aug-11 16:54 
GeneralRe: group by years Pin
sorin_zan23-Aug-11 20:11
sorin_zan23-Aug-11 20:11 
AnswerRe: group by years [modified] Pin
Luc Pattyn23-Aug-11 17:00
sitebuilderLuc Pattyn23-Aug-11 17:00 
GeneralRe: group by years Pin
sorin_zan23-Aug-11 19:38
sorin_zan23-Aug-11 19:38 
GeneralRe: group by years Pin
Shahan Ayyub24-Aug-11 5:59
Shahan Ayyub24-Aug-11 5:59 
GeneralRe: group by years Pin
sorin_zan24-Aug-11 7:17
sorin_zan24-Aug-11 7:17 
QuestionRe: group by years Pin
Shahan Ayyub24-Aug-11 21:52
Shahan Ayyub24-Aug-11 21:52 
AnswerRe: group by years Pin
sorin_zan25-Aug-11 0:26
sorin_zan25-Aug-11 0:26 
GeneralRe: group by years Pin
sorin_zan23-Aug-11 20:09
sorin_zan23-Aug-11 20:09 

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.