I'm attempting to implement functionality for our customers to allow them to change the font for ExplorerBarItems within a group. I need to be able to get the default FontData that is used when an item is added to a group. I'm not having too much luck.
Is there a way to get the font values from the group? I need to get the current font (even if it's the default) so I can pass it to the FontDialog object.
Thanks,
Jim
Any ideas?
Hello Jim,
If you have to get the default Font name from the Items in your Groups you could use the Michael Saltzman's suggestion :
AppearanceData appearanceData = new AppearanceData(); AppearancePropFlags appearancePropFlags = AppearancePropFlags.FontData; this.ultraExplorerBar1.Groups[0].Items[0].ResolveAppearance(ref appearanceData, ref appearancePropFlags);
Font baseFont = this.ultraExplorerBar1.Font; Font createdFont = null; Font itemFont;
try { createdFont = appearanceData.CreateFont(baseFont); itemFont = createdFont != null ? createdFont : baseFont; Debug.WriteLine(itemFont.Name); } finally { if (createdFont != null) createdFont.Dispose(); }
Please do not hesitate to contact us if you have any other questions.
Hi Danko,
I have not yet been able to test the suggested code. I resolved the issue by setting the FontData of the ExplorerBarGroups to a default font at runtime if the user has not changed the font. It works and I had to move on to other stuff.
I'll definitely keep the code reference above in case I need to do something similar at a later date.
Thanks!
Have you been able to take a look at the provided suggestion?
If you have any other questions do not hesitate to contact us.