There is no timeCodeIsolated to achieve general purpose, so let's change the code by yourself.
Figure:
Qq
Beautification method:
UseRendererAttributes andToolstriprendererClass CustomizationToolstripAppearance
Call Method
//Author: along)
//QQ: 646494711
//QQ: 57218890
//Website:Http://www.8timer.com
//Blog:Http://www.cnblogs.com/Along729/
//Disclaimer: No one may publish or sell the source code without the permission of the author. Please respect others' labor achievements. Thank you for your support.
Mainlefttool. Renderer = New Toolstrip ();
Toolstripbutton1.image = New Bitmap ( @" 1. PNG " );
Toolstripbutton2.image = New Bitmap ( @" 2. PNG " );
Toolstripbutton3.image = New Bitmap ( @" 3. PNG " );
Toolstripbutton4.image = New Bitmap ( @" 4. PNG " );
Toolstripbutton5.image = New Bitmap ( @" 5. PNG " );
Toolstripbutton6.image = New Bitmap ( @" 6. PNG " );
Toolstripbutton7.image = New Bitmap ( @" 7. PNG " );
Toolstripbutton8.image = New Bitmap ( @" 8. PNG " );
Toolstripbutton9.image = New Bitmap ( @" Panelcenterbtn.png " );
Re-paint toolstrip code
//Author: along)
//QQ: 646494711
//QQ: 57218890
//Website:Http://www.8timer.com
//Blog:Http://www.cnblogs.com/Along729/
//Disclaimer: No one may publish or sell the source code without the permission of the author. Please respect others' labor achievements. Thank you for your support.
Using System;
Using System. Collections. Generic;
Using System. text;
Using System. Windows. forms;
Using System. drawing;
Using System. Drawing. drawing2d;
Namespace Mainform
{
Public Class Toolstrip: toolstriprenderer
{
Private Int I;
Public Toolstrip ()
{
}
Protected Override Void Initializeitem (toolstripitem item)
{
Base . Initializeitem (item );
Item. autosize = False ;
Item. Height = 30 ;
Item. padding = New Padding ( 5 );
Item. Margin = New Padding ( 0 , 0 , 0 , 1 );
If (Item Is Toolstripbutton)
{
Toolstripbutton BTN = Item As Toolstripbutton;
Item. Width = 30 ;
}
}
# Region // Draw button
Protected Override Void Onrenderbuttonbackground (toolstripitemrendereventargs E)
{
Bool Chk = False ;
Chk = (E. Item As Toolstripbutton). checked;
If (E. Item. pressed && E. Item. Selected)
{
I = 2 ;
}
Else If (E. Item. Selected)
{
I = 1 ;
}
Else If (Chk)
{
I = 2 ;
}
Else
{I = 0 ;}
Imagedrawrect. drawrect (E. Graphics, Global : Mainform. properties. Resources. main_tabbtn, New Rectangle (point. Empty, E. Item. Size), rectangle. fromltrb ( 5 , 15 , 5 , 5 ), I, 2 );
}
# Endregion
}
}
For more information about the test code, see(Winform net technology exchange group: 57218890)Shared Group download