摘要:
/// /// ComboBox 自动调整组合框下拉部分的宽度 /// void ResizeComBox(ComboBox cb,string rowName) { foreach (DataRowView dr in cb.Items) { cb.DropDownWidth = Math.Max(cb.DropDownWidth, TextRenderer.MeasureText(dr[rowName].ToString(), cb.Font).Width); } cb.ClientSize = new Size(cb.DropDownWidth, cb.ClientSize.Hei... 阅读全文