2012-06-20 79 views
0

我想 “画” 斑马线线在我的形式
VB.NET斑马线

zebra

不是表,只是线

白色

白色


ican进口背景图片,但我更喜欢鳕鱼E :)

+0

这是一个WinForm项目?文本如何显示?在一个控件中,还是仅仅绘制到表单的表面? –

+1

我们不能回答你的问题,因为你没有告诉我们你在做什么。你在说什么?一个winForms控件的某种类型的报告gridview,ASP.NET或WinForms或WPF或其他?你试过什么了? –

+0

是的,WinForm我想要斑马线在项目的背景 – BlackOpty

回答

0
TextBox1.Text = 80 
     If IsNumeric(TextBox1.Text) Then 
      Dim color As Integer = 1 
      Dim top As Integer = 10 
      Dim LineNum As Integer = Integer.Parse(TextBox1.Text) 
      For i = 0 To LineNum 
       Dim line As New Panel 
       line.Width = 300 
       line.Height = 40 

       If color = 1 Then 
        color = 0 
        line.BackColor = Drawing.Color.Black 
       Else 
        color = 1 
        line.BackColor = Drawing.Color.White 
       End If 
       top = top + 40 
       line.Top = top 
       Me.Controls.Add(line) 

      Next 

     End If 

;)

+0

它的作品!像往常一样谢谢你! – BlackOpty

0

斑马的datagridview的VB.NET

DataGridView1.GridColor = Color.Blue 
DataGridView1.DefaultCellStyle.ForeColor = Color.Black 
DataGridView1.RowsDefaultCellStyle.BackColor = Color.Red 
DataGridView1.AlternatingRowsDefaultCellStyle.BackColor = Color.Yellow 
DataGridView1.GridColor = Color.Silver