Hey folks.
I'm tying to carry out a simply task of writing a variable double value to a label on my form. The label is called 'lblTotalSeats'. Here's my code below:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace ABCDEFG
{
public partial class MainForm : Form
{
public MainForm()
{
InitializeComponent();
}
private void MainForm_Load(object sender, EventArgs e)
{
}
private void TotalSeats()
{
double totalSeats = 240;
string numberOfSeats = totalSeats.ToString();
lblTotalSeats.Text = numberOfSeats;
}
}
}
My code doesn't throw up any errors when I run it but the value of 240 doesn't display on my label 'lblTotalSeats'.
Any suggestions what I'm doing wrong? I've tried varying it so the method is called "private string TotalSeats(out numberOfSeats) but to no avail too.
I know it's quite simple but as a beginner and a new student to GUI programming, I'm struggling.
Thanks