A
AA
Hi! I'm going through a visual basic book and on that
book the following code is listed. My question is why
can't we just directly use FontName, FontSize, FontBold,
FontItalic and FontUnderline property of Label class for
LblMessage? Why do we use 'special' property Font for
LblMessage from Line#6-10 and then use FontStrikethru and
ForeColor(on Line#11-12) without mentioning Font property
(for LblMessage)? I'm new to this programming language so
can anyone explain this problem step by step? Thanks.
1: ' Set the Font Flags property.
2: CdbFont.Flags = cdlCFBoth Or cdlCFEffects
3: CdbFont.ShowFont ' Display the Font DB
4: ' Set a label's properties to the
5: ' user's selected font information
6: LblMessage.Font.Name = CdbFont.FontName
7: LblMessage.Font.Size = CdbFont.FontSize
8: LblMessage.Font.Bold = CdbFont.FontBold
9: LblMessage.Font.Italic = CdbFont.FontItalic
10: LblMessage.Font.Underline = CdbFont.FontUnderline
11: LblMessage.FontStrikethru = CdbFont.FontStrikethru
12: LblMessage.ForeColor = CdbFont.Color
book the following code is listed. My question is why
can't we just directly use FontName, FontSize, FontBold,
FontItalic and FontUnderline property of Label class for
LblMessage? Why do we use 'special' property Font for
LblMessage from Line#6-10 and then use FontStrikethru and
ForeColor(on Line#11-12) without mentioning Font property
(for LblMessage)? I'm new to this programming language so
can anyone explain this problem step by step? Thanks.
1: ' Set the Font Flags property.
2: CdbFont.Flags = cdlCFBoth Or cdlCFEffects
3: CdbFont.ShowFont ' Display the Font DB
4: ' Set a label's properties to the
5: ' user's selected font information
6: LblMessage.Font.Name = CdbFont.FontName
7: LblMessage.Font.Size = CdbFont.FontSize
8: LblMessage.Font.Bold = CdbFont.FontBold
9: LblMessage.Font.Italic = CdbFont.FontItalic
10: LblMessage.Font.Underline = CdbFont.FontUnderline
11: LblMessage.FontStrikethru = CdbFont.FontStrikethru
12: LblMessage.ForeColor = CdbFont.Color