السلام عليكم
انا عملت برنامج بالفيجوال بيسك 6
فكرة البرنامج مشابهة لفكرة محركات البحث الموجودة ببرامج الاوفيس مثل الورد
الهدف منة ان اكتب نص
و بعد دلك اعمل بحث على كلمة معينة
فادا كانت الكلمة موجودة بيطلع لك رقم الموقع الكلمة الموجودة بالنص
بس انا كنت عايز ان كمان الكلمة الموجودة داخل النص تضلل
المطلوب:
عايز منكم مساعدة و هو كيفية جعل الكلمة الدي بحث عنها بالنص تضلل بالاسود او تتللون
فلو تعرفو الكود بالفيجوال لو سمحتم اعطونا و بكون شاكر
بس بليز انا مستعجل علية جدا
Private Sub Cmdrun_Click() i = 0 If Option1(0).Value = True Then icount = 1 s = UCase(Text1.Text) s = LCase(Text1.Text) n1 = Len(Text1.Text) infound = InStr(icount, s, " ") While icount < n1 And infound <> 0 infound = InStr(icount, s, " ") icount = infound + 1 i = i + 1 Wend Picture1.Print i End If If Option1(1).Value = True Then icount = 1 's = Text1.Text s = UCase(Text1.Text) s = LCase(Text1.Text) n1 = Len(Text1.Text) infound = InStr(icount, s, UCase(Text2)) infound = InStr(icount, s, LCase(Text2)) If infound <> 0 Then Picture1.Print infound Else Picture1.Print "not found" End If End If If Option1(2).Value = True Then Picture1.Cls Text3.Visible = True Text3.SetFocus s = UCase(Text1.Text) s = LCase(Text1.Text) 's = Text1.Text icount = 1 i = 0 n1 = Len(Text1.Text) infound = InStr(icount, s, UCase(Text3)) infound = InStr(icount, s, LCase(Text3)) While infound <> 0 And icount < n1 i = i + 1 icount = infound + 1 infound = InStr(icount, s, UCase(Text3)) infound = InStr(icount, s, LCase(Text3)) Wend If i = 0 Then Picture1.Print "not found" Else Picture1.Print "Total occur="; i End If End If End Sub Private Sub Form_Load() Text2.Visible = False Text3.Visible = False For h = 0 To 2 Option1(h).Value = False Next h End Sub

