在C ++ builder中自定义TDBNavigator按钮

时间:2012-05-04 13:57:18

标签: database delphi c++builder

有没有办法在C ++ builder中为TDBNavigator按钮添加标题?

2 个答案:

答案 0 :(得分:2)

这将允许您为c ++ builder

中的每个按钮添加标题
char *btntext[11] = {"First","Prior","Next","Last","Insert","Delete","Edit","Post","Cancel","Refresh","Apply"};
for(int x = 0; x < nav->ComponentCount; ++x)
    {
    TNavButton* navbutton = dynamic_cast<TNavButton *>( nav->Components[ x ] );
    if( navbutton )
        {
        navbutton->Font->Name = "Arial";
        navbutton->Font->Size = 8;
        navbutton->Caption = btntext[x];
        navbutton->Spacing = 0;
        navbutton->Layout = blGlyphTop;
        }
    }

Example

答案 1 :(得分:1)

这里有一个如何做的完整示例

http://delphi.about.com/od/usedbvcl/l/aa090203a.htm

它是用Delphi编写的,但代码很容易适应c ++ builder。