27-07-23, 11:46 PM
هذا كود يظهر الصنف داخل البانل
عايز السعر يظهر اسفل منه اي تحته
حاولت لكني لم اصب
عايز السعر يظهر اسفل منه اي تحته
حاولت لكني لم اصب
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