17-10-12, 05:36 PM
كاتب الموضوع : AhmedEssawy
اولا يجب عليك اضافه
بعد تعريفك للحدث مع varible في الفورم
الضف الكود التالي علي اعتبار وجود زر اسمعهbutton1
كود :
[color=blue][FONT=Courier New]using[/FONT][/color][FONT=Courier New] Microsoft.Win32;[/FONT]
كود :
[color=blue][FONT=Courier New]public[/FONT][/color][FONT=Courier New] [color=blue]static[/color] [color=blue]event[/color] [color=teal]EventHandler[/color] InstalledFontsChanged;[/FONT]
كود :
[color=blue][FONT=Courier New]private[/FONT][/color][FONT=Courier New] [color=blue]void[/color] button1_Click([color=blue]object[/color] sender, [color=teal]EventArgs[/color] e)[/FONT]
[FONT=Courier New]{[/FONT]
[color=teal][FONT=Courier New]SystemEvents[/FONT][/color][FONT=Courier New]. InstalledFontsChanged+= [color=blue]new[/color] [color=teal]EventHandler[/color](FontHandler);[/FONT]
[FONT=Courier New]}[/FONT]
[color=blue][FONT=Courier New]private[/FONT][/color][FONT=Courier New] [color=blue]void[/color] FontHandler ([color=blue]object[/color] sender, [color=teal]EventArgs[/color] e)[/FONT]
[FONT=Courier New]{[/FONT]
[color=teal][FONT=Courier New]MessageBox[/FONT][/color][FONT=Courier New].Show([color=maroon]"Installed fonts changed."[/color]);[/FONT]
[FONT=Courier New]}[/FONT]