Добрый день!
Я поставил VB.Net 2005 Betta2 и не могу понять где здесь грид который в ВБ6 был MSHFlexGrid.
За ранее спасибо.
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim boldHeader As SourceGrid.Cells.Views.ColumnHeader = New SourceGrid.Cells.Views.ColumnHeader()
Grid.BorderStyle = BorderStyle.FixedSingle
Grid.ColumnsCount = 4
Grid.FixedRows = 1
Grid.Rows.Insert(0)
boldHeader.Font = New Font(Grid.Font, FontStyle.Bold Or FontStyle.Underline)
Dim yellowView As SourceGrid.Cells.Views.Cell = New SourceGrid.Cells.Views.Cell()
yellowView.BackColor = Color.Yellow
Dim yellowViewCheck As SourceGrid.Cells.Views.CheckBox = New SourceGrid.Cells.Views.CheckBox()
yellowViewCheck.BackColor = Color.Yellow
Grid(0, 0) = New SourceGrid.Cells.ColumnHeader("String")
Grid(0, 0).View = boldHeader
Grid(0, 1) = New SourceGrid.Cells.ColumnHeader("DateTime")
Grid(0, 1).View = boldHeader
Grid(0, 2) = New SourceGrid.Cells.ColumnHeader("CheckBox")
Grid(0, 2).View = boldHeader
Dim r As Integer
For r = 1 To 10
Grid.Rows.Insert(r)
Grid(r, 0) = New SourceGrid.Cells.Cell("Hello " + r.ToString(), GetType(String))
Grid(r, 0).View = yellowView
Grid(r, 1) = New SourceGrid.Cells.Cell(DateTime.Today, GetType(DateTime))
Grid(r, 1).View = yellowView
Grid(r, 2) = New SourceGrid.Cells.CheckBox(Nothing, True)
Grid(r, 2).View = yellowViewCheck
Next r
End Sub
End Class
public class MyView : SourceGrid.Cells.Views.Cell
{
protected override void DrawCell_Background(SourceGrid.Cells.ICellVirtual p_Cell,
SourceGrid.Position p_CellPosition, PaintEventArgs e, Rectangle p_ClientRectangle)
{
base.DrawCell_Background (p_Cell, p_CellPosition, e, p_ClientRectangle);
e.Graphics.DrawEllipse(Pens.Red, p_ClientRectangle);
}
}
Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 55