Home > Net >  Winform for datagridview custom scroll bar
Winform for datagridview custom scroll bar

Time:09-25

Due to the system default scroll bar style does not conform to, I want to do, to find a simple way: in the original scroll bar covered a new scroll bar,
For the DataGridview
DataGridview dgvSearch;
Win32API. SetScrollInfo (dgvSearch. Handle, (int) ScrollBarDirection. SB_VERT, ref info, true);
Win32API. PostMessage (dgvSearch. Handle, Win32API. WM_VSCROLL, Win32API MakeLong ((short) Win32API SB_THUMBTRACK, (short) (info. NPos)), 0).
Don't use the API to control DataGridview mobile

For the ListBox
ListBox listBox1;
Win32API. SetScrollInfo (listBox1. Handle, (int) ScrollBarDirection. SB_VERT, ref info, true);
Win32API. PostMessage (listBox1. Handle, Win32API. WM_VSCROLL, Win32API MakeLong ((short) Win32API SB_THUMBTRACK, (short) (info. NPos)), 0).
Scroll bar with the API in the ListBox mobile instead,

Have to solve the problem or you have other better way, if you can, send a demo to me [email protected], refer to the https://blog.csdn.net/wzk456/article/details/48167753 this article

CodePudding user response:

Answer, add cent, top

CodePudding user response:

The top ah, come and help resolve

CodePudding user response:

Come and help to solve the ah
  •  Tags:  
  • C#
  • Related