Ad Space here

Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Share
Options
Go to last post Go to first unread
Dustin Higgins  
#1 Posted : Tuesday, April 23, 2019 12:12:52 PM(UTC)
Dustin Higgins

Rank: Advanced Member

Groups: Registered
Joined: 7/1/2018(UTC)
Posts: 62
_United States

Thanks: 1 times
Was thanked: 6 time(s) in 6 post(s)

I was working on a Windows Form based application that has over 300 controls.  I wanted to come up with a way to make all of the fonts/sizes for the controls configurable programatically.   Here is what I did:

I ended up setting the .tag property on each control.

For example:   Label_Connection.Tag = "H4"

I have a function named "FormatForm" that gets called when the form loads.  It calls a function named "FindAllControls" and loops through them to set the font for each based on what the control tag is set to.

H1 - H5 are bold (big to small)

R1 - R5 are regular (big to small)

I'm not sure if there is a precedence or a better way to do this.  I thought I would share what i did.

Thanks,

Dustin

Sponsor
Ad Space here
Rss Feed  Atom Feed
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.