TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Song Lee
NA
47
38.6k
Adding Double, String value on listbox.
Feb 5 2015 8:41 PM
Hello,
I'm trying to make listbox show a few string and double values when button is pressed.
However, I'm getting errors:
Cannot implicitly convert type 'string' to 'double'
When ever I put double agestr = ageText.Text;
How can I make it so agestr and teethstr text box only accepts double values?
private void
addButton_Click(
object
sender,
EventArgs
e)
{
string
namestr = nameText.Text;
string
agestr = ageText.Text;
//This needs to be double, not string
string
genderstr = genderList.Text;
string
teethstr = teethText.Text;
//This needs to be double, not string
string
tailstr = tailText.Text;
string
row =
String
.Format(
"{0} {1} {2} Has {3} teeth. tail is {4} cm long"
, namestr, agestr, genderstr, teethstr, tailstr);
listBox.Items.Add(row);
}
Reply
Answers (
3
)
how to get latest record from multiple record of same employ
how to get list of latest record of all employee