1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
|
public class SimpleTabControl : TabControl {
private bool simpleMode = false;
/// <summary>
/// Affiche ou non les onglets à l'éxécution
/// </summary>
public bool SimpleMode {
get { return this.simpleMode; }
set {
this.simpleMode = value;
this.RecreateHandle();
}
}
private bool simpleModeInDesign = false;
/// <summary>
/// Affiche ou non les onglets dans le designer
/// </summary>
public bool SimpleModeInDesign {
get { return this.simpleModeInDesign; }
set {
this.simpleModeInDesign = value;
this.RecreateHandle();
}
}
public override Rectangle DisplayRectangle {
get {
if ((this.simpleMode == true) && (!this.DesignMode || this.simpleModeInDesign)) {
return new Rectangle(0, 0, this.Width, this.Height);
}
else
return base.DisplayRectangle;
}
}
} |
Partager