procedure TForm1.DBNavigatorClick(Sender: TObject; Button: TDBNavButtonType);begin with DBNavigator do BEGIN case Button OF nbFirst, nbPrior, nbNext, nbLast, nbInsert, //nbDelete, nbEdit, //nbPost, nbCancel, nbRefresh: {$ifDEF _DEBUG_} ListBox.Items.Add(GetEnumName(TypeInfo(Button), INTeger(Button))); ListBox.ItemIndex := ListBox.Items.Count -1; //WORKS NOT //ShowMessage(GetEnumName(TypeInfo(Button), INTeger(Button))); {$endIF} nbPost, nbDelete: BEGIN Sqlite3Dataset.ApplyUpdates; Sqlite3Dataset.Refresh; {$ifDEF _DEBUG_} ListBox.Items.Add(GetEnumName(TypeInfo(Button), INTeger(Button))); ListBox.ItemIndex := ListBox.Items.Count -1 ; //WORKS //ShowMessage(GetEnumName(TypeInfo(Button), INTeger(Button))); {$endIF} end; end; end;end;
The code fragment is too short to draw any final conclusions.My crystal ball says you are using this code in an OnClick event method of the DBNavigator.If so, then you don't need 'with DBNavigator do'.For my config (see below) it all works as expected.
Probably dbnavigator also has a property button