تقييم الموضوع :
  • 0 أصوات - بمعدل 0
  • 1
  • 2
  • 3
  • 4
  • 5
اظهار السعر اسفل الصنف
#1
هذا كود يظهر الصنف  داخل البانل
عايز السعر يظهر اسفل منه  اي تحته
حاولت لكني لم اصب

PHP كود :
Dim btn As New Button
        Dim rnd 
As New Random
        Dim theprice 
As New TextBox


        Dim int 
As Integer 10
        For i 
As Integer 0 To ds4.Tables("items").Rows.Count 1
            btn 
= New Button
            btn
.Text ds4.Tables("items").Rows(i).Item("invsun").ToString
            btn
.Name ds4.Tables("items").Rows(i).Item("itcod").ToString
                  
'btn.BackColor = System.Drawing.Color.FromName(ds4.Tables("items").Rows(i).Item("colors").ToString)
            Try
                btn.BackColor = System.Drawing.ColorTranslator.FromHtml(ds4.Tables("items").Rows(i).Item("colors").ToString)
            Catch
                btn.BackColor = System.Drawing.Color.FromName(ds4.Tables("items").Rows(i).Item("colors").ToString)
            End Try

          

            btn.Width = 80
            btn.Height = 40
         

            btn.Font = New System.Drawing.Font("Tahoma", 9.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
            If Not IsDBNull(ds4.Tables("items").Rows(i).Item("itimg")) Then


                Dim imageBytes() As Byte = ds4.Tables("items").Rows(i).Item("itimg")
                Dim stream As New MemoryStream(imageBytes)
                Dim buttonImage As Image = Image.FromStream(stream)

                Dim newimg As New Bitmap(buttonImage)
                newimg = New Bitmap(newimg, 32, 32)
                btn.FlatStyle = FlatStyle.Standard
                btn.Image = newimg

                btn.ImageAlign = ContentAlignment.MiddleRight
                btn.TextAlign = ContentAlignment.MiddleLeft

                '
btn.FlatStyle FlatStyle.Flat
                
'btn.FlatAppearance.MouseOverBackColor = Color.Yellow

            End If
                   btn.Left = 10
            btn.Top = int
             

            AddHandler btn.Click, AddressOf btn_Click
            FlowLayoutPanel1.Controls.Add(btn)




            int += 60


        Next
        int = 60
        For i As Integer = 0 To ds4.Tables("items").Rows.Count - 1
            theprice = New TextBox
            theprice.Text = ds4.Tables("items").Rows(i).Item("sprice").ToString


            theprice.Width = 80
            theprice.Height = 20



            theprice.Left = 10
            theprice.Top = int


            FlowLayoutPanel1.Controls.Add(theprice)

            int += 60


        Next 
الرد }}}
تم الشكر بواسطة:
#2
(27-07-23, 11:46 PM)atefkhalf2004 كتب : هذا كود يظهر الصنف  داخل البانل
عايز السعر يظهر اسفل منه  اي تحته
حاولت لكني لم اصب

PHP كود :
Dim btn As New Button
        Dim rnd 
As New Random
        Dim theprice 
As New TextBox


        Dim int 
As Integer 10
        For i 
As Integer 0 To ds4.Tables("items").Rows.Count 1
            btn 
= New Button
            btn
.Text ds4.Tables("items").Rows(i).Item("invsun").ToString
            btn
.Name ds4.Tables("items").Rows(i).Item("itcod").ToString
                  
'btn.BackColor = System.Drawing.Color.FromName(ds4.Tables("items").Rows(i).Item("colors").ToString)
            Try
                btn.BackColor = System.Drawing.ColorTranslator.FromHtml(ds4.Tables("items").Rows(i).Item("colors").ToString)
            Catch
                btn.BackColor = System.Drawing.Color.FromName(ds4.Tables("items").Rows(i).Item("colors").ToString)
            End Try

          

            btn.Width = 80
            btn.Height = 40
         

            btn.Font = New System.Drawing.Font("Tahoma", 9.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
            If Not IsDBNull(ds4.Tables("items").Rows(i).Item("itimg")) Then


                Dim imageBytes() As Byte = ds4.Tables("items").Rows(i).Item("itimg")
                Dim stream As New MemoryStream(imageBytes)
                Dim buttonImage As Image = Image.FromStream(stream)

                Dim newimg As New Bitmap(buttonImage)
                newimg = New Bitmap(newimg, 32, 32)
                btn.FlatStyle = FlatStyle.Standard
                btn.Image = newimg

                btn.ImageAlign = ContentAlignment.MiddleRight
                btn.TextAlign = ContentAlignment.MiddleLeft

                '
btn.FlatStyle FlatStyle.Flat
                
'btn.FlatAppearance.MouseOverBackColor = Color.Yellow

            End If
                   btn.Left = 10
            btn.Top = int
             

            AddHandler btn.Click, AddressOf btn_Click
            FlowLayoutPanel1.Controls.Add(btn)




            int += 60


        Next
        int = 60
        For i As Integer = 0 To ds4.Tables("items").Rows.Count - 1
            theprice = New TextBox
            theprice.Text = ds4.Tables("items").Rows(i).Item("sprice").ToString


            theprice.Width = 80
            theprice.Height = 20



            theprice.Left = 10
            theprice.Top = int


            FlowLayoutPanel1.Controls.Add(theprice)

            int += 60


        Next 

المفروض ان تضع البوتون واللبل في Panel بعدها تضيف هذا البنل في FlowLayoutPanel1
PHP كود :
For As Integer 0 To ds4.Tables("items").Rows.Count 1
            Dim pnl 
As New Panel
            pnl
.Size = New Size(8060)
 
           pnl.BorderStyle BorderStyle.FixedSingle

            Dim btn 
As New Button
            btn
.Dock DockStyle.Top
            btn
.Size = New Size(8040)
 
           btn.Name ds4.Tables("items").Rows(i).Item("itcod").ToString
            btn
.Font = New Font("Tahoma"9.0!, FontStyle.BoldGraphicsUnit.PointCType(0Byte))
 
           btn.Text ds4.Tables("items").Rows(i).Item("invsun").ToString
            Try
                btn
.BackColor ColorTranslator.FromHtml(ds4.Tables("items").Rows(i).Item("colors").ToString)
 
           Catch
                btn
.BackColor Color.FromName(ds4.Tables("items").Rows(i).Item("colors").ToString)
 
           End Try
 
           If Not IsDBNull(ds4.Tables("items").Rows(i).Item("itimg")) Then
                Dim newimg 
As Image = New ImageConverter().ConvertFrom(ds4.Tables("items").Rows(i).Item("itimg"))
 
               newimg newimg.GetThumbnailImage(3232, Function() FalseIntPtr.Zero)
 
               btn.Image newimg
                btn
.ImageAlign ContentAlignment.MiddleRight
                btn
.FlatStyle FlatStyle.Standard
                btn
.TextAlign ContentAlignment.MiddleLeft
            End 
If
 
           AddHandler btn.ClickAddressOf btn_Click
            pnl
.Controls.Add(btn)

 
           Dim theprice As New Label
            theprice
.Dock DockStyle.Bottom
            theprice
.Text ds4.Tables("items").Rows(i).Item("sprice").ToString
            theprice
.TextAlign ContentAlignment.TopCenter
            theprice
.Size = New Size(8020)
 
           pnl.Controls.Add(theprice)

 
           FlowLayoutPanel1.Controls.Add(pnl)
 
       Next 
الرد }}}
تم الشكر بواسطة:
#3
اجابة ممتازة
شكرا
الرد }}}
تم الشكر بواسطة:


المواضيع المحتمل أن تكون متشابهة .
الموضوع : الكاتب الردود : المشاهدات : آخر رد
  [نقاش] بخصوص خصم مبلغ الضريبة من السعر h2551996 6 316 24-01-24, 06:17 PM
آخر رد: Taha Okla
  [سؤال] كود اظهار رساله في حال وجود الرقم في اكثر من عمود مبرمج صغير 1 6 424 09-01-24, 01:41 AM
آخر رد: Taha Okla
  اظهار كرستال ريبورت MOHAMMED ALZWI 0 342 24-08-23, 02:47 PM
آخر رد: MOHAMMED ALZWI
Wink كيفية اظهار قاءمة عند النقر بزر الفأرة الايمن على الداتا قريد فيو في فيجوال 2010 RADOS 1 405 09-08-23, 09:39 PM
آخر رد: أبووسم
  اظهار الاسماء المختلفة من 2 داتا جريد فيو yosif 2 515 14-04-23, 03:50 PM
آخر رد: yosif
  [سؤال] اظهار اداة باكورد على فيجوال بيسك 2008؟ ؟ طالب تقنية المعلومات it 1 502 17-02-23, 10:16 PM
آخر رد: asmarsou
  [سؤال] اظهار بيانات عنصر محدد من DataGrdView في فورم ثاني HUNTER25 9 906 19-12-22, 05:55 PM
آخر رد: HUNTER25
Rainbow [كود] كود اظهار تنبيه عند البحث بأقل من 3 حروف محمد مسافر 3 655 04-12-22, 10:10 AM
آخر رد: أبو خالد الشكري
  [VB.NET] اظهار كلمة المرور ali_ahmed12 2 587 26-11-22, 04:53 PM
آخر رد: ali_ahmed12
  كيفية اظهار رسالة داخل الفيجوال بيزيك واختفائها تلقائياَ بعد فترة ابو نور الهدى 3 1,896 23-11-22, 11:29 PM
آخر رد: Mostafa201255411

التنقل السريع :


يقوم بقرائة الموضوع: بالاضافة الى ( 1 ) ضيف كريم