delphi4arab منتديات دلفي للعرب
كيفة التغير في خصائص InputQuery ؟ - نسخة قابلة للطباعة

+- delphi4arab منتديات دلفي للعرب (https://delphi4arab.net/forum)
+-- قسم : منتديات دلفي للعرب التعليمية (https://delphi4arab.net/forum/forumdisplay.php?fid=3)
+--- قسم : سؤال و جواب حول دلفي (https://delphi4arab.net/forum/forumdisplay.php?fid=15)
+--- الموضوع : كيفة التغير في خصائص InputQuery ؟ (/showthread.php?tid=3784)



كيفة التغير في خصائص InputQuery ؟ - wadoud - 14-01-2012

السلام عليكم


أود إستغلال صندوق الحوار InputQuery الموجود ضمن مكتبة الدلفي كإدخال كلمة السر و التي يجب أن تكون مخفية بهذا الشكل ( *****)

السؤال هل ذلك ممكن؟
و كيف سيكون ذلك ؟

جزاكم الله خيرا .


كيفة التغير في خصائص InputQuery ؟ - wadoud - 14-01-2012

السلام عليكم هنا ارفق مثال على استعمال التابع inputQuery
,و المراد إخفاء كلمة السر اثناء الادخال
كود :
const motdepasse='Delphi4arab'; var reponse:string; nbressais:integer; begin nbressais:=1; reponse:=''; inputquery('verification du mot de passe','entrer le mot de passe',reponse); if reponse<>motdepasse then repeat if reponse='' then showmessage('Mot de passe obligatoire!') else showmessage('Mot de passe incorrect.veuillez recommencez!'); nbressais:=nbressais+1; reponse:=''; inputquery('Verification du mot de passe','Entrer le mot de passe',Reponse); until(reponse=motdepasse)or(nbressais=3); if(nbressais=3)and(reponse<>motdepasse)then begin showmessage('Vous avez oublier votre mot de passe.Veuiller contacter l''administrateur systéme'); close; end



كيفة التغير في خصائص InputQuery ؟ - alkofily - 14-01-2012

السلام عليكم ورحمة الله وبركاته

استخدم نموذج خاص فيه ال
PHP كود :
Edit.passwordChar=* 



كيفة التغير في خصائص InputQuery ؟ - wadoud - 16-01-2012

اشكرك على الرد ولكني لا أرغب في إستعمال فورم بها edit
لكني أركزفي سؤالي على inputQuery


كيفة التغير في خصائص InputQuery ؟ - alkofily - 16-01-2012

السلام عليكم ورحمة الله وبركاته

الطريقة فيما أعلم أنك لا بد من إضافة خاصية كلمة السر(*) في خانة النص الموجودة داخل ال inputquery

ولكي تتمكن من ذلك يجب عليك معرفة الـ Handle

إليك هذا الرابط في كود التغيير
كود :
http://www.delphipages.com/forum/showthread.php?tid=172547

ومن الأفضل لك أن تجعل فورم خاصة نستخدمها متى أردت


كيفة التغير في خصائص InputQuery ؟ - kachwahed - 16-01-2012

وعليكم السلام ورحمة الله
الفكرة تعتمد على التعديل على المكون من خلال مقبضه كما قال الأخ alkofily
مثال Thomas Stutz
PHP كود :
const
  
InputBoxMessage = WM_USER + 200;

type
  TForm1 
= class(TForm)
    
Button1: TButton;
    
procedure Button1Click(Sender: TObject);
  private
    
procedure InputBoxSetPasswordChar(var Msg: TMessage); message InputBoxMessage;
  public
  
end;

var
  
Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.InputBoxSetPasswordChar(var Msg: TMessage);
var
  
hInputForm, hEdit, hButton: HWND;
begin
  hInputForm 
:= Screen.Forms[0].Handle;
  if (
hInputForm <> 0) then
  begin
    hEdit 
:= FindWindowEx(hInputForm, 0, 'TEdit', nil);
    {
      
// Change button text:
      
hButton := FindWindowEx(hInputForm, 0, 'TButton', nil);
      
SendMessage(hButton, WM_SETTEXT, 0, Integer(PChar('Cancel')));
    }
    
SendMessage(hEdit, EM_SETPASSWORDCHAR, Ord('*'), 0);
  
end;
end;

procedure TForm1.Button1Click(Sender: TObject);
var
  
InputString: string;
begin
  PostMessage
(Handle, InputBoxMessage, 0, 0);
  
InputString := InputBox('Input Box', 'Please Enter a Password', '');
end; 
بطريقة أخرى يمكنك إعادة تعريف CreateMessageDialog من المكتبة Dialogs.pas بالشكل الذي تريد.
بالتوفيق.



كيفة التغير في خصائص InputQuery ؟ - wadoud - 17-01-2012

اشكركم

ساحاول العمل بما قاله الأخ alkofily.

جزاكم الله خيرا