بوابة الثانوية العامة المصرية

بوابة الثانوية العامة المصرية (https://www.thanwya.com/vb/index.php)
-   أرشيف المنتدى (https://www.thanwya.com/vb/forumdisplay.php?f=513)
-   -   اريد كود لهذا السؤال (https://www.thanwya.com/vb/showthread.php?t=535050)

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

اقتباس:

المشاركة الأصلية كتبت بواسطة hass****hawy (المشاركة 5399546)
كود:

        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


بارك الله في اخي الفاضل حسن علي هذا االحل الرائع والمفسر


جميع الأوقات بتوقيت GMT +2. الساعة الآن 03:31 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.