TDBNavigator Glyph ändern
-
hat jemand eine Idee wie ich bei einem DBNavigator text als auch die bilder verändern kann?
danke
-
Hab mal was gefunden, aber leider sind danach alle button grau. first.bmp ist 16x16 px groß und eigentlich voller farbiger pixel. kann einer helfen.
void __fastcall TForm1::ChangeDBNavImage(TDBNavigator *DBnav) { int i; Graphics::TBitmap *tempGlyph; String ExePath; /* ChangeDBNavImage */ ExePath = ExtractFilePath(Application->ExeName); tempGlyph = new Graphics::TBitmap(); String NAVBUTTON = "TNavButton"; try { for ( i = 0; i < DBnav->ControlCount; i++ ) { String button = DBnav->Controls[i]->ClassName(); if ( button == NAVBUTTON ) { TNavButton *nb = (TNavButton *)DBnav->Controls[i]; switch(nb->Index) { case nbFirst: tempGlyph->LoadFromFile(ExePath+"first.bmp"); break; case nbPrior: tempGlyph->LoadFromFile(ExePath+"first.bmp"); break; case nbNext: tempGlyph->LoadFromFile(ExePath+"first.bmp"); break; case nbLast: tempGlyph->LoadFromFile(ExePath+"first.bmp"); break; case nbInsert: tempGlyph->LoadFromFile(ExePath+"first.bmp"); break; case nbDelete: tempGlyph->LoadFromFile(ExePath+"first.bmp"); break; case nbEdit: tempGlyph->LoadFromFile(ExePath+"first.bmp"); break; case nbPost:tempGlyph->LoadFromFile(ExePath+"first.bmp"); break; case nbCancel: tempGlyph->LoadFromFile(ExePath+"first.bmp"); break; case nbRefresh:tempGlyph->LoadFromFile(ExePath+"first.bmp"); break; } nb->Glyph = tempGlyph; // <-- Assign the loaded bitmap } }//for i } __finally { delete tempGlyph; }//try }//ChangeDBNavImage //---------------------------------------------------------------------------