本文整理汇总了C#中System.Windows.Forms.ListBox.Hide方法的典型用法代码示例。如果您正苦于以下问题:C# ListBox.Hide方法的具体用法?C# ListBox.Hide怎么用?C# ListBox.Hide使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.ListBox
的用法示例。
在下文中一共展示了ListBox.Hide方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AutoCompleteTagger
public AutoCompleteTagger()
{
asKeyWords = new string[0];
sbHorz = new HScrollBar();
sbHorz.Scroll += sbHorz_Scroll;
sbHorz.Height = 14;
sbHorz.Hide();
lbSuggest = new ListBox();
lbSuggest.MouseUp += lbSuggest_MouseUp;
lbSuggest.MouseMove += lbSuggest_MouseMove;
lbSuggest.VisibleChanged += lbSuggest_VisibleChanged;
lbSuggest.Hide();
}
示例2: Initialise
private void Initialise()
{
string fontFamily = ReadProperty<string>( "FontsAndColors", "TextEditor", "FontFamily", "Courier New" );
short fontSize = ReadProperty<short>( "FontsAndColors", "TextEditor", "FontSize", 10 );
_font = new Font( fontFamily, ( float )fontSize );
_listBox = new Form.ListBox();
_listBox.DrawMode = Form.DrawMode.OwnerDrawVariable;
_listBox.Width = 340;
_listBox.Height = 200;
_listBox.DrawItem += ListBoxDrawItem;
_listBox.MeasureItem += ListBoxMeasureItem;
_listBox.KeyDown += ListBoxKeyDown;
_listBox.DoubleClick += ListBoxDoubleClick;
_listBox.LostFocus += ListBoxLostFocus;
_listBox.Hide();
_window = new Window( (IntPtr) AddIn.TextDocument.DTE.MainWindow.HWnd );
_fontSize = TextRenderer.MeasureText( "W", _font );
_fontSize.Width = TextRenderer.MeasureText( "WW", _font ).Width - _fontSize.Width;
_fontSize.Height -= 1;
//WriteProperty<bool>( "TextEditor", "SQL", "AutoListMembers", false );
//WriteProperty<bool>( "TextEditor", "SQL", "AutoListParams", true );
_window.SetParent( _listBox.Handle );
}
示例3: AutoCompleteTextBox
public static void AutoCompleteTextBox(TextBox txtControl, ListBox lstControl,
List<string> lstAutoCompleteList, KeyEventArgs txtControlKEA)
{
Point cp;
GetCaretPos(out cp);
List<string> lstTemp = new List<string>();
//Positioning the Listbox on TextBox by Type Insertion Cursor position
lstControl.SetBounds(cp.X + txtControl.Location.X, cp.Y + txtControl.Location.Y + 20, 150, 50);
var TempFilteredList = lstAutoCompleteList.Where
(n => n.StartsWith(GetLastString(txtControl.Text))).Select(r => r);
lstTemp = TempFilteredList.ToList<string>();
if (lstTemp.Count != 0 && GetLastString(txtControl.Text) != "")
{
lstControl.DataSource = lstTemp;
lstControl.Show();
lstControl.BringToFront();
}
else
{
lstControl.Hide();
}
//Code for focusing ListBox Items While Pressing Down and UP Key.
if (txtControlKEA.KeyCode == Keys.Down)
{
lstControl.SelectedIndex = 0;
lstControl.Focus();
txtControlKEA.Handled = true;
}
else if (txtControlKEA.KeyCode == Keys.Up)
{
lstControl.SelectedIndex = lstControl.Items.Count - 1;
lstControl.Focus();
txtControlKEA.Handled = true;
}
//text box key press event
txtControl.KeyPress += (s, kpeArgs) =>
{
if (kpeArgs.KeyChar == (char)Keys.Enter)
{
if (lstControl.Visible)
{
lstControl.Focus();
}
kpeArgs.Handled = true;
}
else if (kpeArgs.KeyChar == (char)Keys.Escape)
{
lstControl.Visible = false;
kpeArgs.Handled = true;
}
else if (kpeArgs.KeyChar == (char)Keys.Tab)
{
txtControl.Text = ((ListBox)s).SelectedItem.ToString();
txtControl.Select(txtControl.Text.Length, 0);
txtControl.Focus();
lstControl.Hide();
}
};
txtControl.LostFocus += (s, eventArgs) =>
{
if (!lstControl.Focused)
lstControl.Hide();
};
//listbox keyup event
lstControl.KeyUp += (s, kueArgs) =>
{
if (kueArgs.KeyCode == Keys.Tab)
{
//string StrLS = GetLastString(txtControl.Text);
//int LIOLS = txtControl.Text.LastIndexOf(StrLS);
//string TempStr = txtControl.Text.Remove(LIOLS);
//txtControl.Text = TempStr + ((ListBox)s).SelectedItem.ToString();
txtControl.Text = ((ListBox)s).SelectedItem.ToString();
txtControl.Select(txtControl.Text.Length, 0);
txtControl.Focus();
lstControl.Hide();
}
else if (kueArgs.KeyCode == Keys.Escape)
{
lstControl.Hide();
txtControl.Focus();
}
};
}
示例4: AutoCompleteTagger
public AutoCompleteTagger()
{
asKeyWords = new string[0];
AutoWordSelection = AutoWordSelectionOverride;
ScrollBars = RichTextBoxScrollBars.None;
WordWrap = false;
grBase = CreateGraphics();
lbSuggest = new ListBox();
lbSuggest.MouseUp += lbSuggest_MouseUp;
lbSuggest.MouseMove += lbSuggest_MouseMove;
lbSuggest.VisibleChanged += lbSuggest_VisibleChanged;
lbSuggest.Hide();
}