منتدى فيجوال بيسك لكل العرب | منتدى المبرمجين العرب
اظهار السعر اسفل الصنف - نسخة قابلة للطباعة

+- منتدى فيجوال بيسك لكل العرب | منتدى المبرمجين العرب (http://vb4arb.com/vb)
+-- قسم : قسم لغة الفيجوال بيسك VB.NET (http://vb4arb.com/vb/forumdisplay.php?fid=182)
+--- قسم : قسم اسئلة VB.NET (http://vb4arb.com/vb/forumdisplay.php?fid=183)
+--- الموضوع : اظهار السعر اسفل الصنف (/showthread.php?tid=46635)



اظهار السعر اسفل الصنف - atefkhalf2004 - 27-07-23

هذا كود يظهر الصنف  داخل البانل
عايز السعر يظهر اسفل منه  اي تحته
حاولت لكني لم اصب

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 



RE: اظهار السعر اسفل الصنف - عبد الخالق - 28-07-23

(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 



RE: اظهار السعر اسفل الصنف - atefkhalf2004 - 28-07-23

اجابة ممتازة
شكرا