التحقق من ال editbox قبل ادخاله في listbox ؟
#6
جرب هكذا Smile

PHP كود :
procedure TForm1.BitBtn1Click(Sender: TObject);
var
  
sName: string;
  
x: Integer;
begin
  sName 
:= Edit1.Text;
  if 
Trim(sName) <> '' then
  begin
    
for x := 0 to listbox1.Items.Count - 1 do
    
begin
      
if Listbox1.Items.Strings[x] = sName then
      begin
        MessageBox
(Handle,
          
PChar('Name Already Exists : ' + sName),
          
PChar('Error'),
          
MB_ICONERROR);
        Exit;
      
end;
    
end;
    
Statusbar1.Panels.Items[2].Text := sName;
    
Listbox1.Items.Add(sName);
    
Label1.Caption := IntToStr(Listbox1.Items.Count);
  
end;
end; 

عندك اخطاء اخرى بما يخص حفظ و فتح الملفات..

يجب ان تكون الأوامرالتي تنفذ تحت شروط في Block واحد يعني بين Begin و end مستقلة
PHP كود :
if xxxxx.Execute then
begin
...
...
...
...
end; 

بالتوفيق ان شاء الله
الرد


الردود في هذا الموضوع
التحقق من ال editbox قبل ادخاله في listbox ؟ - بواسطة STRELiTZIA - 17-12-2008, 08:54 AM

التنقل السريع :


يقوم بقرائة الموضوع: بالاضافة الى ( 1 ) ضيف كريم