Click here to Skip to main content
15,909,615 members
Home / Discussions / C#
   

C#

 
Questionhow to make a gird of pictureboxs with c# Pin
mores.JR19-Sep-18 7:15
mores.JR19-Sep-18 7:15 
AnswerRe: how to make a gird of pictureboxs with c# Pin
OriginalGriff19-Sep-18 8:05
mveOriginalGriff19-Sep-18 8:05 
GeneralRe: how to make a gird of pictureboxs with c# Pin
mores.JR20-Sep-18 9:55
mores.JR20-Sep-18 9:55 
QuestionImage processing Pin
Member 266560619-Sep-18 3:39
Member 266560619-Sep-18 3:39 
AnswerRe: Image processing Pin
OriginalGriff19-Sep-18 4:18
mveOriginalGriff19-Sep-18 4:18 
AnswerRe: Image processing Pin
Pete O'Hanlon19-Sep-18 5:05
mvePete O'Hanlon19-Sep-18 5:05 
QuestionApplications settings get messed up Pin
Acuena18-Sep-18 3:32
Acuena18-Sep-18 3:32 
QuestionC# Beginner - Online Student Project Pin
Member 1398787017-Sep-18 13:14
Member 1398787017-Sep-18 13:14 
I am a 100% online student trying to learn C#. My instructor has not been of help, so I am looking for help elsewhere.

My homework is to create a program that will convert measurements:

"
In the English measurement system, 1 yard equals 3 feet and 1 foot equals 12 inches. Use this information to create an application that lets the user convert distances to and from inches, feet, and yards. Use list boxes for the user to select units being converted from and another list box for the user to select units being converted from. 
 
Write your code in the following order
Program must check for correct input into the textbox. Hint: use TryParse.
Check that user has selected a from unit. If not, let user know no unit has been selected.
Check that user has selected a to unit. If user selects the same unit for both from and to, let them know that they need to select a different unit.
"

I believe I have my TryParse correct. It will make sure a measurement has been entered, a from distance has been selected and a to distance has been selected. After that, I am not sure where to proceed. I don't know how to grab what is selected in the from groupbox to the to groupbox and then convert. Any help would be appreciated. Thanks!

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Distance_Converter
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void convertButton_Click(object sender, EventArgs e)
        {
            double distanceInput;
            double inches;
            double feet;
            double yards;
            string measurementFrom;

            if (double.TryParse(distanceTextBox.Text, out distanceInput));
            {
                if (fromListBox.SelectedIndex != -1)
                {
                    if (toListBox.SelectedItem = != -1)
                    {
                        

                    }
                }

            }

        }
    }
}


Image of UI: Capture — imgbb.com[^]
AnswerRe: C# Beginner - Online Student Project Pin
Mycroft Holmes17-Sep-18 14:17
professionalMycroft Holmes17-Sep-18 14:17 
QuestionC# help with classes and a method Pin
Member 1398782717-Sep-18 11:36
Member 1398782717-Sep-18 11:36 
AnswerRe: C# help with classes and a method Pin
Mycroft Holmes17-Sep-18 14:05
professionalMycroft Holmes17-Sep-18 14:05 
Questionsoap web services Pin
Member 1398714017-Sep-18 0:49
Member 1398714017-Sep-18 0:49 
AnswerRe: soap web services Pin
Pete O'Hanlon17-Sep-18 1:35
mvePete O'Hanlon17-Sep-18 1:35 
GeneralRe: soap web services Pin
Member 1398714017-Sep-18 23:55
Member 1398714017-Sep-18 23:55 
AnswerRe: soap web services Pin
OriginalGriff17-Sep-18 2:56
mveOriginalGriff17-Sep-18 2:56 
GeneralRe: soap web services Pin
Member 1398714017-Sep-18 23:54
Member 1398714017-Sep-18 23:54 
QuestionDynamic Multi dimensional list Pin
Mohammad Azeem13-Sep-18 10:56
Mohammad Azeem13-Sep-18 10:56 
AnswerRe: Dynamic Multi dimensional list Pin
Richard Deeming13-Sep-18 11:14
mveRichard Deeming13-Sep-18 11:14 
AnswerRe: Dynamic Multi dimensional list Pin
David A. Gray13-Sep-18 19:08
David A. Gray13-Sep-18 19:08 
QuestionC# form AxMsRdpClient9NotSafeForScripting (RDP onlogonerror event) Pin
Member 1030250812-Sep-18 6:44
Member 1030250812-Sep-18 6:44 
AnswerRe: C# form AxMsRdpClient9NotSafeForScripting (RDP onlogonerror event) Pin
Matias Lopez12-Sep-18 9:32
Matias Lopez12-Sep-18 9:32 
GeneralRe: C# form AxMsRdpClient9NotSafeForScripting (RDP onlogonerror event) Pin
Member 1030250812-Sep-18 10:36
Member 1030250812-Sep-18 10:36 
GeneralRe: C# form AxMsRdpClient9NotSafeForScripting (RDP onlogonerror event) Pin
Matias Lopez12-Sep-18 10:42
Matias Lopez12-Sep-18 10:42 
GeneralRe: C# form AxMsRdpClient9NotSafeForScripting (RDP onlogonerror event) Pin
Member 1030250812-Sep-18 10:47
Member 1030250812-Sep-18 10:47 
GeneralRe: C# form AxMsRdpClient9NotSafeForScripting (RDP onlogonerror event) Pin
Member 103025081-Feb-19 2:07
Member 103025081-Feb-19 2:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.