Sure! Here's an example of a Goodbye program in C# that meets the given requirements:
using System;
using System.Windows.Forms;
namespace GoodbyeProgram
{
public class GoodbyeForm : Form
{
private Label goodbyeLabel;
private Button spanishButton;
private Button frenchButton;
private Button germanButton;
private Button exitButton;
private PictureBox countryImage;
private Label horizontalRule;
public GoodbyeForm()
{
// Set up form properties
this.Text = "Goodbye Program";
// Create controls
goodbyeLabel = new Label();
goodbyeLabel.Text = "Goodbye";
spanishButton = new Button();
spanishButton.Text = "Spanish";
spanishButton.Click += SpanishButton_Click;
frenchButton = new Button();
frenchButton.Text = "French";
frenchButton.Click += FrenchButton_Click;
germanButton = new Button();
germanButton.Text = "German";
germanButton.Click += GermanButton_Click;
exitButton = new Button();
exitButton.Text = "Exit";
exitButton.Click += ExitButton_Click;
countryImage = new PictureBox();
countryImage.Image = Properties.Resources.USA; // Replace with actual image files for each country
horizontalRule = new Label();
horizontalRule.BorderStyle = BorderStyle.Fixed3D;
// Set up control positions and sizes
goodbyeLabel.Location = new System.Drawing.Point(50, 50);
goodbyeLabel.AutoSize = true;
spanishButton.Location = new System.Drawing.Point(50, 100);
spanishButton.Size = new System.Drawing.Size(100, 30);
frenchButton.Location = new System.Drawing.Point(50, 150);
frenchButton.Size = new System.Drawing.Size(100, 30);
germanButton.Location = new System.Drawing.Point(50, 200);
germanButton.Size = new System.Drawing.Size(100, 30);
exitButton.Location = new System.Drawing.Point(50, 250);
exitButton.Size = new System.Drawing.Size(100, 30);
countryImage.Location = new System.Drawing.Point(200, 50);
countryImage.Size = new System.Drawing.Size(100, 100);
horizontalRule.Location = new System.Drawing.Point(0, 300);
horizontalRule.Size = new System.Drawing.Size(this.Width, 2);
// Add controls to the form
this.Controls.Add(goodbyeLabel);
this.Controls.Add(spanishButton);
this.Controls.Add(frenchButton);
this.Controls.Add(germanButton);
this.Controls.Add(exitButton);
this.Controls.Add(countryImage);
this.Controls.Add(horizontalRule);
}
private void SpanishButton_Click(object sender, EventArgs e)
{
goodbyeLabel.Text = "Adiós";
}
private void FrenchButton_Click(object sender, EventArgs e)
{
goodbyeLabel.Text = "Au revoir";
}
private void GermanButton_Click(object sender, EventArgs e)
{
goodbyeLabel.Text = "Auf Wiedersehen";
}
private void ExitButton_Click(object sender, EventArgs e)
{
this.Close();
}
[STAThread]
static void Main()
{
Application.Run(new GoodbyeForm());
}
}
}
Please note that you would need to have actual image files for each country and update the image paths in the program accordingly.