• 2024-08-20【Winform】TabControl使用汇总
     一、改变标签颜色tabControl1.DrawMode=System.Windows.Forms.TabDrawMode.OwnerDrawFixed;ItemTabControl.DrawItem+=newSystem.Windows.Forms.DrawItemEventHandler(ItemTabControl_DrawItem); privatevoidtabControl1_DrawI
  • 2023-09-20自定义重绘TabControl的各个标签
    设置DrawItem事件privatevoidtabControl1_DrawItem(objectsender,DrawItemEventArgse)//绘制tabcontrol控件的标签颜色和字体大小{SolidBrushback;SolidBrushwhite;SolidBrushblack=newSolidBrush(Color.Black);//字体的颜色if(e.Index==tabControl1.SelectedI
  • 2023-06-23记WinForm DataGridView 新增行号列
    下面是 DataGridView 新增行号封装的通用方法:1///<summary>2///给DataGridView添加行号3///</summary>4///<paramname="dgv"></param>5///<paramname="e"></param>
  • 2023-03-20Winform-ToolStripButton实现高清红黄绿指示灯(改善图片造成的模糊)
     //自定义控件(ToolStripButton)publicpartialclassRoundButton:ToolStripButton{protectedoverridevoidOnPaint(PaintEventArgspevent)
  • 2023-03-01【C#】Color使用汇总
    一、自定义颜色this.BackColor=Color.FromArgb(255,255,255);//红、绿、蓝 应用于Pen、Brush、SolidBrush等:privatePenCustomizePenColor=newPen(Color.F