Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

User interface considerations

Status
Not open for further replies.

cpmasesa

Programmer
Oct 24, 2002
78
AE
Hello ALL,

i have made a database app and want to improve the functionality of the user interface.

In 'edit' forms i used TDBEdit. I want to change color of an edit control IIF that field has been changed by the user (edited). How can i do this?? I cannot find an AfterEdit event on TField.

In 'browser' forms data is displayed in a TDBGrid. Two of the fields are Lookup fields so there is a dropdown box in the grid for these fields.

I want when user types 'C' the drop down opens and moves to 1st entry starting with 'C' (if it is there). Again how can i do this??

Maybe there are freeware/shareware somponents that can do this stuff??

TIA

cpmasesa
 
Make a global variable on your form and use the TDBEdits onenter and onexit events to see if they have changed.

var
Changed : String;

procedure TForm1.Enter(Sender: TObject);
begin
Changed := TDBEdit(Sender).Text;
end;

procedure TForm1.Enter(Sender: TObject);
begin
if TDBEdit.Text = Changed then TDBEdit(Sender).Color := clWhite else TDBEdit(Sender).Color := clAqua;
end;

Then just add the "Enter" procedure to the onenter event of your TDBEdits and vice versa for the onexit

Arte Et Labore
 
The second procedure should be TForm1.Exit(Sender: TObject);

Whos says cutting and pasting your text saves time!

Arte Et Labore
 
>>I want when user types 'C' the drop down opens and moves >>to 1st entry starting with 'C' (if it is there). Again >>how can i do this??

If you drop a TComboBox component on your form and set its' 'AutoComplete' property to 'True' then it should perform this functionality. Check out the Delphi help.


Clive [infinity]
Ex nihilo, nihil fit (Out of nothing, nothing comes)
 
I think autocomplete is only present on Delphi 6 and above (could be wrong), so if it isnt there, there are plenty of free third party components which can do this for you.

Arte Et Labore
 
EricDraven: (TheCrow??!!)

Thanks, it worked like a dream!! have to modify it so it will work for other controls eg dbcombo, dblookupcombo, etc

StrectchWickster:

I want the behaviour in a GridColumn not a plain combobox.

Can you suggest a freeware/shareware dbgrid that does this AND displays Boolean fields with a check mark if true??

TIA

cpmasesa
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top