مشاهدة النسخة كاملة : اريد كود لهذا السؤال


marsho
22-07-2013, 11:37 PM
اريد كود يقوم باختيار textbox عشوائى من 5

اى يختار واحد فقط من 5 كل مرة يتم تغير هذا textbox عند عمل ريفريش للصفحة

hassanalhawy
23-07-2013, 10:57 PM
Dim r_t As Byte
TextBox1.Visible = False
TextBox2.Visible = False
TextBox3.Visible = False
TextBox4.Visible = False
TextBox5.Visible = False
Randomize()
r_t = Rnd() * 5
If r_t = 1 Then TextBox1.Visible = True
If r_t = 2 Then TextBox2.Visible = True
If r_t = 3 Then TextBox3.Visible = True
If r_t = 4 Then TextBox4.Visible = True
If r_t = 5 Then TextBox5.Visible = True

أحمد هاشم الزيدي
03-08-2013, 06:06 PM
dim r_t as byte
textbox1.visible = false
textbox2.visible = false
textbox3.visible = false
textbox4.visible = false
textbox5.visible = false
randomize()
r_t = rnd() * 5
if r_t = 1 then textbox1.visible = true
if r_t = 2 then textbox2.visible = true
if r_t = 3 then textbox3.visible = true
if r_t = 4 then textbox4.visible = true
if r_t = 5 then textbox5.visible = true
بارك الله في اخي الفاضل حسن علي هذا االحل الرائع والمفسر