Welcome to Dream.In.Code
Getting VB.NET Help is Easy!

Join 86,383 VB.NET Programmers. There are 1,397 online right now! Ask your question and get quick answers from Dream.In.Code experts. Join the #1 programming help community on the internet! Registration is fast and FREE... Join Now!

Chat LIVE With a VB.NET Expert
Powered by LivePerson.com

Register to Make This Box Go Away!

how to use FontChanged in vb.net

 
Reply to this topicStart new topic

how to use FontChanged in vb.net

mghata
post 7 May, 2008 - 09:29 PM
Post #1


New D.I.C Head

*
Joined: 7 May, 2008
Posts: 1



Following Code i m using in VB,but how to implement in vb.net that is dont know.... plz answer me....


Datagrid.HeadFont = FontChanged(.HeadFont, "Arial")
Datagrid.HeadFont = FontChanged(.HeadFont, 9)
Datagrid.HeadFont = FontChanged(.HeadFont, "bold")
Datagrid.Font = FontFamily..Font, "Courier New")
Datagrid.Font = FontChangeSize(.Font, 10)
User is offlineProfile CardPM
Go to the top of the page
+Quote Post


Martyr2
post 8 May, 2008 - 10:30 PM
Post #2


Programming Theoretician

Group Icon
Joined: 18 Apr, 2007
Posts: 3,561

Well the fontchanged event is pretty much like any event. The event is fired whenever the font of a control is changed to a new font. In the example below we set the font of a button to a new Arial 12pt sized regular font

vb

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Button1.Font = New Font("Arial", 12, FontStyle.Regular, GraphicsUnit.Point, Font.GdiCharSet())
End Sub


When this font change happens (by clicking the button) it will trigger the Button1's fontchanged event

vb

Private Sub Button1_FontChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.FontChanged
MessageBox.Show("Font for Button1 has been changed!")
End Sub


So essentially changing the font of a control will kick off the fontchanged event for that control if one is setup.

Hope that is what you were wanting to know. Enjoy!

"At DIC we be fontchanging code ninjas, we also change our ninja undies on a regular basis too." decap.gif
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

krazzy4
post 9 May, 2008 - 03:34 AM
Post #3


New D.I.C Head

*
Joined: 1 May, 2008
Posts: 15

u can also use the font dialogbox so that u can select the font,size,style at run time....[smile.gif]
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 5/17/08 03:44AM

Live VB.NET Help!

VB.NET Tutorials

Reference Sheets

VB.NET Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month