Typecast Font.Style ?
Jeg har 3xCheckBox hvor programmets bruger skal kunne afgøre Font.Style på nogle Labels.Jeg har bygget det op på nedenstående måde men får desværre compilerfejl på nederste linie: Font.Style := FontStyleString;, Kan FontStyleString Typecastes til Font.Style eller er jeg nødt til at skrive kode som dækker alle 9 kombinationer ?
if cbBold.Checked then
FontStyleString := \'[fsBold\'
else
FontStyleString := \'\';
if (FontStyleString <> \'\') and cbItalic.Checked then
FontStyleString := FontStyleString + \', fsItalic\'
else
FontStyleString := \'[fsItalic\';
if (FontStyleString <> \'\') and cbUnderline.Checked then
FontStyleString := FontStyleString + \', fsUnderline\'
else
FontStyleString := \'[fsUnderline\';
FontStyleString := FontStyleString + \']\';
Font.Style := FontStyleString;
