I have no clue if this is possible or not as I'm new to C#. But is it possible to make a Windows Forms look like the picture? Where you have a
- gradient at top
- alternating color rows
- change the default text color
- change the default highlight color
- change the way the scroll bar looks
If so, are there tutorials for these someone can po开发者_JAVA技巧int me to?
- Gradient effects will take tedious paint task. You have some example here
Alternating Row Colors,
datagridview1.AlternatingRowsDefaultCellStyle.BackColor= Color.Blue;
Change Text Color
datagridview1.RowsDefaultCellStyle.ForeColor = Color.Red;
Change Highlight Color
`datagridview1.RowsDefaultCellStyle.SelectionBackColor = Color.Pink;
As far as I know scroll-bar will have the look of your current system theme and cant be change that easily unless you write your own code for it.
Regarding skinning (gradients, custom scroll bar): WinForms are a wrapper around Win32 native controls. They were not designed with visual appearance customization in mind. It is possible but will require an awful lot of work: There is nothing comparable to CSS in WinForms.
An arguably easier alternative would be WPF.
Of course, the most straightforward might be to look for a 3rd party component such as Krypton's DataGrid (free).
精彩评论