![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Programmer
Join Date: Oct 2005
Posts: 48
Rep Power: 0
![]() |
I have buttons that created programmatically, how to set the button's fon size programmatically?
for( int nCounter=0; nCounter <MaxNumber ; nCounter++ ) { Button tempButton = new Button(); tempButton.Top = ....; tempButton.Left = ....; tempButton.Height = ....; tempButton.Height = 90; tempButton.Width = 86; tempButton.Parent = this; tempButton.Enabled = true; tempButton.BackColor = Color.Gray; tempButton.TextAlign = ContentAlignment.BottomCenter; ..... } |
|
|
|
|
|
#2 |
|
Expert Programmer
Join Date: Jun 2005
Posts: 825
Rep Power: 4
![]() |
Try something like:
tempButton.Font = new Font(tempButton.Font.FontFamily, 26); I haven't tried this, I just read the documentation. |
|
|
|
|
|
#3 |
|
Programmer
Join Date: Oct 2005
Posts: 48
Rep Power: 0
![]() |
Thank you, The Dark.
It's work. :-) I also added somrthing like this : tempButton.Font = new Font(tempButton.Font.FontFamily, 10, tempButton.Font.Style | FontStyle.Bold); to make the font bold. |
|
|
|
|
|
#4 | |
|
Expert Programmer
|
Quote:
![]()
__________________
Join us at #programmingforums @ irc.freenode.net! My software never has bugs. It just develops random features.
|
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|