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

Dynamic Control

بدأه mahmola في 17 سبتمبر 2008 · 2 رد · 691 مشاهدة · في قواعد بيانات Microsoft Access
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

Hi All

How to create a new Dynamic control like TextBox in run time

i made it in design view using this code(i found it in Access help) but i want it in run time

Sub NewControls()
	Dim frm As Form
	Dim ctlLabel As Control, ctlText As Control
	Dim intDataX As Integer, intDataY As Integer
	Dim intLabelX As Integer, intLabelY As Integer

	' Create new form with Orders table as its record source.
	Set frm = CreateForm
	frm.RecordSource = "Orders"
	' Set positioning values for new controls.
	intLabelX = 100
	intLabelY = 100
	intDataX = 1000
	intDataY = 100
	' Create unbound default-size text box in detail section.
	Set ctlText = CreateControl(frm.name, acTextBox, , "", "", _
		intDataX, intDataY)
	' Create child label control for text box.
	Set ctlLabel = CreateControl(frm.name, acLabel, , _
		 ctlText.name, "NewLabel", intLabelX, intLabelY)
	' Restore form.
	DoCmd.Restore
End Sub

and by the way

i tried the same thing in Visual Studio 2008 VB and it's work using this code

		Dim te As TextBox
		te = New TextBox
		te.Text = "hi"
		te.Parent = Me

Thaanks In Advance

1 2 me and u r alone

1 2 u a i a a

#2

عندي فورم و بدي حط فيا تيكست بوكس بس من الكود مو من الديزاينر

ها هيي كل القصة

ممكن حدا يجاوب

شكرا

1 2 me and u r alone

1 2 u a i a a

#3

مشان الفائدة العلمية

الحل يلي وصلتلو بالأخير هوي أنو لازم لاقي حل تاني غير الدايناميك لأنو الأكسيس غبي شوي

أو اني ابني الفورم بال Design mode و بعدو اعملا RUN

شكرا

1 2 me and u r alone

1 2 u a i a a

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