C#Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.
You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
I have a simple combo box with some values in it for the drop down. I can't see those values inside of the drop down but they are there, its like the font is set to clear because i've tried changing the font color and background color but still can't see a thing. I am able to select a value from the drop down even tho I can't see it and it will appear in the text field.
I've create a solution with just a combo box and some values inside of it and it still doesn't work. I've downloaded some examples and they don't work. Is there a setting on my .NET which is doing this? I've tried putting a refresh for the combo box and that doesn't work.
Hello,
I think you may try to uninstall and reinstall the Visual Studio .NET or may be the windows itself, I don't know, that may solve the problem, good luck :)
Make a new application and put a combobox in it and add items to it thru the ITEM COLLECTION property.
If it shows the items correctly then you know that the problem lies in your program only. try it.
Do get back if the problem persists.
using System;
using System.Windows.Forms;
using System.Drawing;
public class MyForm : Form {
public MyForm() {
System.Windows.Forms.ComboBox cb = new System.Windows.Forms.ComboBox();
cb.Location = new Point(45,80);
cb.Size = new Size (232,20);
cb.Font = new Font ("Verdana", 10);
cb.Text= " Select One Option ";
cb.Items.Add("Freshers");
cb.Items.Add("Less than 6 Months");
cb.Items.Add("From 6 Months To 2 Years");
cb.Items.Add("From 2 Months To 5 Years");
cb.Items.Add("From 5 Months To 10 Years");
cb.Items.Add("Above 10 Years");
this.Controls.Add(cb);
}
public static void Main(string[] args) {
MyForm f = new MyForm();
Application.Run(f);
}
}