Hi,
Please check this.
Bolded the changed code lines.
private void AllcomboBox_DrawItem(object sender, System.Windows.Forms.DrawItemEventArgs e)
{
ComboBox cBox = (ComboBox)sender;
DataRowView drv = (DataRowView)cBox.Items[e.Index];
string name = drv[0].ToString();
Font myFont = new System.Drawing.Font("Comic Sans", 11);
e.DrawBackground();
e.DrawFocusRectangle();
using (Brush textBrush = new SolidBrush(e.ForeColor))
{
Rectangle bounds = e.Bounds;
using (StringFormat format = new StringFormat())
{
format.LineAlignment = StringAlignment.Center;
format.Alignment = StringAlignment.Near;
e.Graphics.DrawString(name, cBox.Font, textBrush, bounds, format);
}
}
}