在主窗体创建时,根据登陆用户权限;动态创建连接窗体的按钮;
现在功能实现了;但出现一个小问题;就是tfcoutlooklist中的按钮的text字体怎么修改都是绿色的;各位兄弟帮忙看看哪里出问题了。procedure TForm1.Button2Click(Sender: TObject);
var
Afcoutlookpage:TFcoutlookpage;
afcoutlooklistItem: TfcOutLookListItem;
begin
AfcOutLookPage := OutLookMain.OutlookItems.Add;
with AfcOutLookPage do //列表头
begin
OutlookList.Transparent := true;
OutlookList.Font := Frm_Main.Font; //设置让字体与
if FontDialog1.Execute then
AfcOutLookPage.OutlookList.Font := FontDialog1.Font; //自选字体
OutLookList.Font.Color := OutLookMain.Font.Color; //更改字体颜色
Button.Caption := 'test';
AfcOutLookPage.OutlookList.Images := Img_OutBookList;
end; afcoutlooklistItem := AfcOutLookPage.OutlookList.Items.Add;
with afcoutlooklistItem do
begin
Text := 'test';
Hint := 'test';
ImageIndex := 0;
onclick := OutlookListItemClick;
end;
end;
现在功能实现了;但出现一个小问题;就是tfcoutlooklist中的按钮的text字体怎么修改都是绿色的;各位兄弟帮忙看看哪里出问题了。procedure TForm1.Button2Click(Sender: TObject);
var
Afcoutlookpage:TFcoutlookpage;
afcoutlooklistItem: TfcOutLookListItem;
begin
AfcOutLookPage := OutLookMain.OutlookItems.Add;
with AfcOutLookPage do //列表头
begin
OutlookList.Transparent := true;
OutlookList.Font := Frm_Main.Font; //设置让字体与
if FontDialog1.Execute then
AfcOutLookPage.OutlookList.Font := FontDialog1.Font; //自选字体
OutLookList.Font.Color := OutLookMain.Font.Color; //更改字体颜色
Button.Caption := 'test';
AfcOutLookPage.OutlookList.Images := Img_OutBookList;
end; afcoutlooklistItem := AfcOutLookPage.OutlookList.Items.Add;
with afcoutlooklistItem do
begin
Text := 'test';
Hint := 'test';
ImageIndex := 0;
onclick := OutlookListItemClick;
end;
end;
但字体还是没有改变;这样理解的话,应该是设置的位置不对 ;
也就是说不应该设置AfcOutLookPage.OutlookList.Font ;那么,应该设置那个对象的字体来改变按钮的text字体属性?
试试将语句:
OutlookList.Font := Frm_Main.Font;
改成outlooklist.font.assign(frm_main.font);如果还不行,就考虑在最后直接设定字体颜色值;
OutLookList.Font.Color := clblack;