开发者

Customizing Windows Forms (table)

开发者 https://www.devze.com 2023-04-01 02:24 出处:网络
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

Customizing Windows Forms (table)

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

  1. gradient at top
  2. alternating color rows
  3. change the default text color
  4. change the default highlight color
  5. change the way the scroll bar looks

If so, are there tutorials for these someone can po开发者_JAVA技巧int me to?


  1. Gradient effects will take tedious paint task. You have some example here
  2. Alternating Row Colors,

    datagridview1.AlternatingRowsDefaultCellStyle.BackColor= Color.Blue;

  3. Change Text Color

    datagridview1.RowsDefaultCellStyle.ForeColor = Color.Red;

  4. Change Highlight Color

    `datagridview1.RowsDefaultCellStyle.SelectionBackColor = Color.Pink;

  5. 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).

0

精彩评论

暂无评论...
验证码 换一张
取 消