الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

عايز ألف على كل ال Textbox

بدأه kazabra في 4 أبريل 2009 · 6 رد · 674 مشاهدة · في Microsoft Visual Basic.NET
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

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

انا عملت الكود ده بس مش شغال

	Public Sub SaveMe(ByVal mFormName As Object)

		Dim mControl
			 '=================================================

		For Each mControl In mFormName.controls

			If TypeName(mControl) = "TextBox" Then


			End If
		Next

		  End Sub

التكست بوكس بداخل فرام

هو جابلى الفرام بس

تم تعديل هذه المشاركة بواسطة kazabra في 4 أبريل 2009 في 21:27

#2

Dim cnt As Control

For Each cnt In Me.Controls

If TypeOf cnt Is TextBox Then

End If

Next

#3

Thx Reda For Help But You Write It Without Try It And It's the Same Code that i Made

And If You Have Frame Contain any controls Will Not Determined At Cnt Variable You Must Make another loop on Controls that It's Container Is GroupBox

and I wanna code To loop On all Text at form Ever If it's Parent Is Frame or tab Or any container control

And thx Reda Again

#4

مرحباً أخي الكريم,

في المرفقات مثال بسيط عن كيفية تطبيق عمليات مرجعية تستدعي نفسها لإيجاد عنصر أو قيمة معينة,

جربه, أمل أن يقوم بما تريده

بالتوفيق

HowToFindControl.zip

The important thing is not so much

that every child should be taught,

as that every child should be given the wish to learn.

#5

thx bashar So much

And this Sub i Made it To get All controls At form

Public Function GetControls(ByVal mGroupControl As Control) As String

	Dim mcontrol As Control
	Dim mString As String
	'======================

	For Each mcontrol In mGroupControl.Controls

		If TypeName(mcontrol) = "TextBox" Then

			mString = IIf(mString <> "", mString & ",", "") & mcontrol.Name

		ElseIf TypeName(mcontrol) = "GroupBox" Then

			mString = IIf(mString <> "", mString & ",", "") & GetControls(mcontrol, MValue)

		End If
	Next

	Return mString

End Function
#6

lol XD :P, You're Welcome :)

B.T.W==> By the way ===> You can use 'TypeOf' Statement to know the type of the source class, so I think it woulda be better, using >>> something like this :

 

[color= #b1b100;]If TypeOf MControl Is GroupBox Then

[color= #0000ff;]' Your Code

[color= #0000ff;]End If

[color= #0000ff;] 

 

[color= #0000ff;]

And something else, You can use the select case statement, like this :

 

Select Case [color= #000000; font-weight: bold;]True

[color= #b1b100;]Case [color= #009900;](TypeOf MControl Is TextBox [color= #009900;])

[color= #0000ff;]' Your Code Here

[color= #0000ff;]Case (TypeOf MControl Is GroupBox )

[color= #0000ff;]' Your Code Here

[color= #b1b100;]Case [color= #009900;](TypeOf MControl Is PictureBox [color= #009900;])

[color= #0000ff;]' Your Code Here

[color= #0000ff;]Case (TypeOf MControl Is FlowLayoutPanel )

[color= #0000ff;]' Your Code Here

[color= #b1b100;]Case [color= #b1b100;]Else

[color= #0000ff;]' Your Code Here

[color= #0000ff;]End Select

[color= #0000ff;]

Good luck :P

تم تعديل هذه المشاركة بواسطة Bashar Rabat في 9 أبريل 2009 في 19:10

The important thing is not so much

that every child should be taught,

as that every child should be given the wish to learn.

#7

Thx Bashar Again

BTW :D I Need Another Help can i Check On Control if is Container

Mean Groupbox Or Panel Or Tabs What Ever

مواضيع مشابهة