(JVCL - JEDI) Is it possible to change the caption on JvLoginDialog1 that says "type your user name and password to enter the application" ?
Asked
Active
Viewed 227 times
2 Answers
1
I presume you're talking about the "hint label", instead of the Caption
which you can change in OI. You can modify/localize RsHintLabel
resource string in 'jvresources.pas' for that. Also see other entries under the heading 'JvLoginForm.pas' in the same unit.
Sertac Akyuz
- 52,752
- 4
- 91
- 157
1
I didn't want to change the original source code (last change: 2004!) because it would get lost on reinstallation. So I cheated:
class procedure TFormMain.ApplicationOnModalBegin(Sender: TObject);
begin
with Application do
if Components[ComponentCount - 1] is TJvLoginForm then
(Components[ComponentCount - 1] as TJvLoginForm).OnFormShow:= JvLoginFormShow;
end;
class procedure TFormMain.JvLoginFormShow(Sender: TObject);
begin
(Sender as TJvLoginForm).HintLabel.Caption:= 'my hint';
end;
Note: TJvLoginDialog has an OnShow event, it just doesn't work. It would make it a lot easier to customize the dialog. I did not test it, but I guess the fix could be in function TJvLoginDialog.DoLogin
: add OnFormShow:= Self.OnShow;
.
maf-soft
- 1,773
- 2
- 15
- 37
-
Does it always have to be the last component? – Sertac Akyuz Sep 26 '18 at 19:53
-
I guessed so - the form is always newly created directly before it becomes modal. So it should be at the end of the list - or not? @SertacAkyuz – maf-soft Sep 26 '18 at 21:14
-
Probably. Still iterating through the components might be safer. Or not? ... ;) – Sertac Akyuz Sep 26 '18 at 22:13