以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  [求助] NavBar 字体如何用代码设置?  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=42349)

--  作者:coch2004
--  发布时间:2013/11/8 19:29:00
--  [求助] NavBar 字体如何用代码设置?

Dim Bar As WinForm.NavBar
Bar = e.Form.Controls("NavBar1")

bar.NavPages(0).font=New Font("宋体",12,FontStyle.Bold Or FontStyle.Underline)


bar.font=New Font("宋体",12,FontStyle.Bold Or FontStyle.Underline)

 

这两个代码对于导航栏的字体都没有反应!

 

请问正确的怎么写法?


--  作者:有点甜
--  发布时间:2013/11/8 19:54:00
--  
 只能整体设置button的字体,如下代码

Dim Bar = e.Form.Controls("NavBar1").basecontrol
bar.ButtonFont = New Font("宋体",18,FontStyle.Bold Or FontStyle.Underline)

--  作者:有点甜
--  发布时间:2013/11/8 19:56:00
--  
 标题的font

Dim Bar = e.Form.Controls("NavBar1").basecontrol
bar.PanelHeaderFont= New Font("宋体",18,FontStyle.Bold Or FontStyle.Underline)

--  作者:coch2004
--  发布时间:2013/11/8 20:08:00
--  
以下是引用有点甜在2013-11-8 19:56:00的发言:
 标题的font

Dim Bar = e.Form.Controls("NavBar1").basecontrol
bar.PanelHeaderFont= New Font("宋体",18,FontStyle.Bold Or FontStyle.Underline)

 

谢了! 要的就是这个效果,每个人的分辨率不同,让他们自己设置字体大小

 

 

 


图片点击可在新窗口打开查看此主题相关图片如下:2013-11-08_200823.jpg
图片点击可在新窗口打开查看

 

郁闷!

[此贴子已经被作者于2013-11-8 20:09:07编辑过]

--  作者:有点甜
--  发布时间:2013/11/8 20:18:00
--  
 呵呵,楼主,学vb.net去。
--  作者:coch2004
--  发布时间:2013/11/8 20:21:00
--  

再请教一下:

 

为什么设置不了字体颜色:

Dim Bar = e.Form.Controls("NavBar1").basecontrol
bar.ButtonFont = New Font("宋体",18,FontStyle.Bold Or FontStyle.Underline)

 

试了以下四种方式每种方式都是错的.

 

bar.buttonfont.color= color.red
bar.buttonfont.backcolor= color.red
bar.buttonbackcolor=Color.red
bar.buttoncolor=Color.red


--  作者:有点甜
--  发布时间:2013/11/8 20:40:00
--  
 不能单独设置按钮的字体颜色的,只能总体改变控件的样式 VisualStyle