C2026-043-Tech-Debt_v1 - Stash 1
This commit is contained in:
@@ -1,8 +1,5 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Text;
|
||||
using System.Drawing;
|
||||
using System.Windows.Forms;
|
||||
|
||||
@@ -10,19 +7,11 @@ namespace Volian.Controls.Library
|
||||
{
|
||||
public partial class BorderListBox : ListBox
|
||||
{
|
||||
#region Properties
|
||||
public GridLinePattern SelectedLinePattern
|
||||
{
|
||||
get { return (Items[SelectedIndex] as GridLBItem).LinePattern; }
|
||||
}
|
||||
#endregion
|
||||
#region ctor
|
||||
public BorderListBox()
|
||||
{
|
||||
InitializeComponent();
|
||||
SetupOptions();
|
||||
}
|
||||
public BorderListBox(IContainer container)
|
||||
#region Properties
|
||||
public GridLinePattern SelectedLinePattern => (Items[SelectedIndex] as GridLBItem).LinePattern;
|
||||
#endregion
|
||||
#region ctor
|
||||
public BorderListBox(IContainer container)
|
||||
{
|
||||
container.Add(this);
|
||||
InitializeComponent();
|
||||
@@ -31,9 +20,7 @@ namespace Volian.Controls.Library
|
||||
private void SetupOptions()
|
||||
{
|
||||
this.DrawMode = DrawMode.OwnerDrawFixed;
|
||||
//this.Font.Size;
|
||||
DrawItem += new DrawItemEventHandler(BorderListBox_DrawItem);
|
||||
//MeasureItem += new MeasureItemEventHandler(BorderListBox_MeasureItem);
|
||||
Items.Add(new GridLBItem(GridLinePattern.None));
|
||||
Items.Add(new GridLBItem(GridLinePattern.Single));
|
||||
Items.Add(new GridLBItem(GridLinePattern.Double));
|
||||
@@ -55,10 +42,6 @@ namespace Volian.Controls.Library
|
||||
}
|
||||
#endregion
|
||||
#region Event Handlers
|
||||
//void BorderListBox_MeasureItem(object sender, MeasureItemEventArgs e)
|
||||
//{
|
||||
// e.ItemHeight = 22;
|
||||
//}
|
||||
private int _MaxLabelWidth = 0;
|
||||
private int MaxLabelWidth(Graphics gr)
|
||||
{
|
||||
@@ -102,25 +85,14 @@ namespace Volian.Controls.Library
|
||||
}
|
||||
public class GridLBItem
|
||||
{
|
||||
#region Properties
|
||||
private GridLinePattern _LinePattern;
|
||||
public GridLinePattern LinePattern
|
||||
{
|
||||
get { return _LinePattern; }
|
||||
set { _LinePattern = value; }
|
||||
}
|
||||
#endregion
|
||||
#region ctor
|
||||
public GridLBItem(GridLinePattern linePattern)
|
||||
{
|
||||
LinePattern = linePattern;
|
||||
}
|
||||
#endregion
|
||||
#region Public Methods
|
||||
public override string ToString()
|
||||
{
|
||||
return LinePattern.ToString();
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
#region Properties
|
||||
public GridLinePattern LinePattern { get; set; }
|
||||
#endregion
|
||||
#region ctor
|
||||
public GridLBItem(GridLinePattern linePattern) => LinePattern = linePattern;
|
||||
#endregion
|
||||
#region Public Methods
|
||||
public override string ToString() => LinePattern.ToString();
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user