/// <summary> /// Show a tooltip /// </summary> /// <param name="textBox"></param> /// <param name="items"></param> private static void ShowTooltip(TextBox textBox, EnhancedTextBoxHelper.Items[] items) { if (textBox != null) { if (!String.IsNullOrEmpty(textBox.Text)) { EnhancedTextBoxHelper.Items item = items.FirstOrDefault(r => r._value == textBox.Text); if (item != null) { if (item._values != null) { string tooltipText = ""; foreach (string value in item._values) tooltipText += value + " "; if (textBox.Visible && tooltip.Tag == null) { if (!tooltipShown) { tooltip.Show(tooltipText, textBox, textBox.Width / 2, textBox.Height / 2); tooltip.Tag = textBox; tooltipShown = true; } else { tooltip.Hide(textBox); tooltip.Tag = null; tooltipShown = false; } } } } } } }