private void SRComboBoxEx_SelectedIndexChanged(object sender, EventArgs e) { this.UpdatePieChart(); try { if (this.SelectedSR != null) { ComboBoxIconExItem selectedItem = (ComboBoxIconExItem)this.SRComboBoxEx.SelectedItem; ToStringWrapper <WinAPI.SR> item = (ToStringWrapper <WinAPI.SR>)selectedItem.Item; if (item != null) { this.SRDisplayNameToolTip.SetToolTip(this.SRComboBoxEx, item.ToString()); } else { this.SRDisplayNameToolTip.SetToolTip(this.SRComboBoxEx, ""); } } else { this.SRDisplayNameToolTip.SetToolTip(this.SRComboBoxEx, ""); } } catch { } }
public override string ToString() { if (Enabled) { return(stringWrapper.ToString()); } return(String.Format(Messages.SELECT_STORAGE_DROPDOWN_ERROR_NOT_ENOUGH_SPACE, stringWrapper)); }
private void IScsiTargetIqnComboBox_SelectedIndexChanged(object sender, EventArgs e) { ToStringWrapper <IScsiIqnInfo> wrapper = comboBoxIscsiIqns.SelectedItem as ToStringWrapper <IScsiIqnInfo>; ClearLunMapAndCombo(); HideAllErrorIconsAndLabels(); if (wrapper != null) { TargetIqnToolTip.SetToolTip(comboBoxIscsiIqns, wrapper.ToString()); IscsiPopulateLUNs(); } else { TargetIqnToolTip.SetToolTip(comboBoxIscsiIqns, Messages.SELECT_TARGET_IQN); } }
private void comboBoxIscsiIqns_SelectedIndexChanged(object sender, EventArgs e) { ToStringWrapper <IScsiIqnInfo> wrapper = comboBoxIscsiIqns.SelectedItem as ToStringWrapper <IScsiIqnInfo>; // Keep the IScsiTargetIqnComboBox tooltip in sync with the selected item if (wrapper != null) { TargetIqnToolTip.SetToolTip(comboBoxIscsiIqns, wrapper.ToString()); } else { TargetIqnToolTip.SetToolTip(comboBoxIscsiIqns, ""); } // Clear the LUN map and ComboBox because the user has changed the IQN. The user // must re-discover the LUNs for the new IQN. ClearLunMapAndCombo(); }
void NewMasterComboBox_DrawItem(object sender, DrawItemEventArgs e) { if (NewMasterComboBox.Enabled) { using (SolidBrush backBrush = new SolidBrush(NewMasterComboBox.BackColor)) { e.Graphics.FillRectangle(backBrush, e.Bounds); } if (e.Index == -1) { return; } ToStringWrapper <Host> host = NewMasterComboBox.Items[e.Index] as ToStringWrapper <Host>; if (host == null) { return; } Graphics g = e.Graphics; Rectangle bounds = e.Bounds; Image icon = Images.GetImage16For(host.item); // Now draw the image g.DrawImage(icon, bounds.Left + 1, bounds.Top + 1, bounds.Height - 2, bounds.Height - 2); Rectangle bump = new Rectangle(bounds.Height, bounds.Y, bounds.Width - bounds.Height - RIGHT_PADDING, bounds.Height); // And the text Drawing.DrawText(g, host.ToString(), e.Font, bump, e.ForeColor, e.BackColor, TextFormatFlags.Left | TextFormatFlags.VerticalCenter); } else { using (SolidBrush backBrush = new SolidBrush(SystemColors.Control)) { e.Graphics.FillRectangle(backBrush, e.Bounds); } if (e.Index == -1) { return; } ToStringWrapper <Host> host = NewMasterComboBox.Items[e.Index] as ToStringWrapper <Host>; if (host == null) { return; } Graphics g = e.Graphics; Rectangle bounds = e.Bounds; Image icon = Images.GetImage16For(host.item); // Now draw the image g.DrawImage(icon, new Rectangle(bounds.Left + 1, bounds.Top + 1, bounds.Height - 2, bounds.Height - 2), 0, 0, icon.Width, icon.Height, GraphicsUnit.Pixel, Core.Drawing.GreyScaleAttributes); Rectangle bump = new Rectangle(bounds.Height, bounds.Y, bounds.Width - bounds.Height - RIGHT_PADDING, bounds.Height); // And the text Drawing.DrawText(g, host.ToString(), e.Font, bump, SystemColors.GrayText, SystemColors.Control, TextFormatFlags.Left | TextFormatFlags.VerticalCenter); } }