Tryng to work on a program to make a menu on form1. What it will do is display the different things offered at the restaurant and the text will scrolll from the bottom of the screen to the top and then repeat.
I was able to figure out how to make labels dynamically but I can't figure out how to display them on form1.
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 cafeteka_mod1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
int fav = 9;
void allamerican()
{
Label[] labels = new Label[fav];
for(int i = 0; i < fav; i++)
{
labels[i] = new Label();
}
for(int a = 0; a < fav; a++)
{
this.Controls.Add(labels[a]);
}
string[] one = { "ALL AMERICAN FAVOURITES","Cafe Americano... $35",
"Capuccino... $40",
"Cafe Latta... $40",
"Macchiato... $50",
"Mocha... $40",
"Mocha Blanco... $50",
"Espresso... $30",
"Mocha Organico... $60",
"Cold Brew... $50"};
for(int y = 0; y < fav; y++)
{
labels.Text = one.ToString();
}
}
private void timer1_Tick(object sender, EventArgs e)
{
}
}
}