delphi4arab منتديات دلفي للعرب
مشكل إنتقال المؤشر - نسخة قابلة للطباعة

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



مشكل إنتقال المؤشر - بوزيان - 15-08-2019

ما طريقة جعل المؤشر في edit  عند تنفيد أمر البحث في هذا المثال المرفق أي لا ينتقل إلى richedit، مع إبقاء الأمر في Edit1Change

[size=small]
.rar   TrichEdit Text Color.rar (الحجم : 608.67 ك ب / التحميلات : 36)
.rar   TrichEdit Text Color.rar (الحجم : 608.67 ك ب / التحميلات : 36)
.rar   TrichEdit Text Color.rar (الحجم : 608.67 ك ب / التحميلات : 36) المثال المرفق
[/size]



RE: مشكل إنتقال المؤشر - samnaj00 - 17-08-2019

(15-08-2019, 02:52 PM)بوزيان كتب : ما طريقة جعل المؤشر في edit  عند تنفيد أمر البحث في هذا المثال المرفق أي لا ينتقل إلى richedit، مع إبقاء الأمر في Edit1Change

[size=small]المثال المرفق[/size]
اخي الكريم
فقط احذف من هذا الكود هذه الكلمة setfocus

كود :
procedure RE_ColorerMots(RE: TRichEdit; Mot: ShortString; AColor: TColor; var Count: integer); // 3 secondes 37 secondes 721 ms pour 4784 mots dans Zola992K.txt de 992 Ko label Recomm; var   FoundAt: LongInt;   StartPos, ToEnd: Integer; begin   Count := 0;   with RE do   begin     // Commence la recherche après la sélection en cours s'il y en a une sinon, commence au début du texte     if SelLength <> 0       then StartPos := SelStart + SelLength     else StartPos := 0;     Recomm:     ToEnd := Length(Text) - StartPos; // ToEnd indique la longueur entre StartPos et la fin du texte du RichEdit     FoundAt := FindText(Mot, StartPos, ToEnd, [stMatchCase]);     if FoundAt <> -1 then     begin     inc(Count); فقط احذف هذه الكلمة setfocus     SetFocus;     SelStart := FoundAt;       SelLength := Length(Mot);       SelAttributes.Color := AColor;       StartPos := FoundAt + Length(Mot);       if StartPos < length(Text) then goto Recomm;     end;     SelLength := 0;   end; end;



RE: مشكل إنتقال المؤشر - بوزيان - 17-08-2019

(17-08-2019, 04:59 PM)samnaj00 كتب :
(15-08-2019, 02:52 PM)بوزيان كتب : ما طريقة جعل المؤشر في edit  عند تنفيد أمر البحث في هذا المثال المرفق أي لا ينتقل إلى richedit، مع إبقاء الأمر في Edit1Change

[size=small]المثال المرفق[/size]
اخي الكريم
فقط احذف من هذا الكود هذه الكلمة setfocus

كود :
procedure RE_ColorerMots(RE: TRichEdit; Mot: ShortString; AColor: TColor; var Count: integer); // 3 secondes 37 secondes 721 ms pour 4784 mots dans Zola992K.txt de 992 Ko label Recomm; var   FoundAt: LongInt;   StartPos, ToEnd: Integer; begin   Count := 0;   with RE do   begin     // Commence la recherche après la sélection en cours s'il y en a une sinon, commence au début du texte     if SelLength <> 0       then StartPos := SelStart + SelLength     else StartPos := 0;     Recomm:     ToEnd := Length(Text) - StartPos; // ToEnd indique la longueur entre StartPos et la fin du texte du RichEdit     FoundAt := FindText(Mot, StartPos, ToEnd, [stMatchCase]);     if FoundAt <> -1 then     begin     inc(Count); فقط احذف هذه الكلمة setfocus     SetFocus;     SelStart := FoundAt;       SelLength := Length(Mot);       SelAttributes.Color := AColor;       StartPos := FoundAt + Length(Mot);       if StartPos < length(Text) then goto Recomm;     end;     SelLength := 0;   end; end;
جزاك الله خيرا