Lainkes
Members-
Content Count
72 -
Joined
-
Last visited
Community Reputation
0 NeutralRecent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
-
Good evening, I have a program that shows a grid with records (client data). I was wondering what the best practices is to use this form for adding a new client or editing a new client. I was thinking to use a boolean flag (new_client := True or false). If the flag is True, I know that the form is for adding a new client, so I use the append option. When False, I know it's just for editing the data. Or do I use 2 different forms for this purpose? Thanks for your feedback. Greetings Lainkes
-
I managed to loop with ControlCount. First I disable all controls on my panel. Then I enable my PageControl. And as last I loop all mu controls on my PageControl and set them disabled. // SET ALL COMPONENTS TO READONLY // Disable first all components for I := 0 to RzPanel1.ControlCount - 1 do RzPanel1.Controls[I].Enabled := False; // Enable TabSheets PageControl1.Enabled := True; // Disable components in PageControl for I := 0 to PageControl1.ControlCount - 1 do PageControl1.Controls[I].Enabled := False; Thanks for the help and hints. Alain
-
I also thought that. But once you disable the panel, nothing can be changed.
-
OK, thanks this is what I was looking for. But one little problem. I have a PageControl. And when I disable the panel, I cannot switch between the different pages of the Pagecontrol.
-
Hello, If a record is closed, I need to make the form with all the info read only. Is this possible in one commend? Or do I have to disable all the components one by one? Thanks Alain
-
It seems that it was not in edit mode after all. My mistake.
-
Thanks. But now I get an error on the line DTP_STAT_HAND_GRIF_VOL_DOSSIER_OPVR_DATE.Field.AsDateTime := Now; when opening my form.
-
I added a line with the lowest date possible, but it's not working. I'm sure it's something stupid, but no idea what it is. if TDBCheckBox(sender).Checked then begin // write selected date to DB : OK DTP_STAT_HAND_GRIF_VOL_DOSSIER_OPVR_DATE.Checked := True; DTP_STAT_HAND_GRIF_VOL_DOSSIER_OPVR_DATE.Visible := True; DTP_STAT_HAND_GRIF_VOL_DOSSIER_OPVR_DATE.Date := Now; end else begin // write unusable date to DB : NOT OK DTP_STAT_HAND_GRIF_VOL_DOSSIER_OPVR_DATE.Date := strToDAte('30/12/1899'); DTP_STAT_HAND_GRIF_VOL_DOSSIER_OPVR_DATE.Checked := False; DTP_STAT_HAND_GRIF_VOL_DOSSIER_OPVR_DATE.Visible := False; end;
-
Thanks for the info. I'll try to make it more specific. I activated the ShowCheckBox property. I have a DBCheckbox where the user can indicate if more info is needed. (check or uncheck) See screenshot. When the DBCheckbox is not checked, the datetimepicker component must be unvisible. And the date in the database must be set to a value that is not usable (like 30/12/1899). If checked, the datetimepicker must be visible and the selected date must be saved. This is my code. procedure Tfrm_Page_Control.DBCheckBox44Click(Sender: TObject); begin if TDBCheckBox(sender).Checked then begin // write selected date to DB : OK DTP_STAT_HAND_GRIF_VOL_DOSSIER_OPVR_DATE.Checked := True; DTP_STAT_HAND_GRIF_VOL_DOSSIER_OPVR_DATE.Visible := True; DTP_STAT_HAND_GRIF_VOL_DOSSIER_OPVR_DATE.Date := Now; end else begin // write unusable date to DB : NOT OK DTP_STAT_HAND_GRIF_VOL_DOSSIER_OPVR_DATE.Checked := False; DTP_STAT_HAND_GRIF_VOL_DOSSIER_OPVR_DATE.Visible := False; end; end; But when I uncheck the DBCheckbox, nothing changes in my DB. The last saved date is still available. Thanks for your feedback and help. (or alternative solution).
-
Hallo, I want to assign a null value to a DateTimePicker when a checkbox is checked to tell the user that no date is needed. So I assign the value NULL (found in some other internet topics) that will be converted to '30/12/1899'. DTP_STAT_HAND_GRIF_VOL_DOSSIER_OPVR_DATE.Date := Null; I get an error message when this code is executed. See attached image. To be complete, this is a DBDateTimePicker (Konopka) that is linked with my datasource. So the meaning is to write directly a null value to the database when hitting the save button on my form. Any idea what I'm doing wrong? Tips and tricks are welcome. Greetings Alain
-
I just want to make it visible like in most programs when you click on the About link in the menu. Is there some kind of tutorial about this? I never used components/code from outside the standard Delphi environment.
-
Hello, I want to use some kind of versioning in my program. Example every time I build my program, I want to see in a text field the version. (ex 4.1.2). And I also want to see the latest date when the program was build. Maybe even add comments on what I changed in the program. Is this a standard behaviour that I can use from Delphi? Or how can I implement this in my program? Thanks for your advice. Greetings Alain
-
I add a screenshot of my form settings. So it's more clear. (I hope)
-
Thanks. This works as the called form is closed. So this works fine. My program starts with a small login screen where user credentials are needed. When the login is succesful the main form appears. But the login screen is still visible behind the mainform until the mainform is closed. How can I close the login screen directly when the main form is showed. // SHOW MAIN FORM try mainkForm := Tfrm_Main.Create(Self); try mainkForm.ShowModal; finally mainkForm.Free; Release; // CLOSE CURRENT LOGIN FORM end; except on E: Exception do DoShowException(E); end;
-
Hello, I have a form with a button. When the button is clicked, a new form opens to input data. So when this button is clicked, I need to close the current form with the button. This is my code : I have put the Close command in the Finally section. But that's not working. I thought that was the right place, so that even in case of an error the screen is closed. Maybe I'm thinkin wrong. Thanks for your feedback. Alain