Error CS0104 'TextBox' is an ambiguous reference between 'System.Windows.Forms.TextBox'
and 'System.Windows.Forms.VisualStyles.VisualStyleElement.TextBox' Line 50
Error CS0104 'Button' is an ambiguous reference between 'System.Windows.Forms.Button'
and 'System.Windows.Forms.VisualStyles.VisualStyleElement.Button' Line 51
Error CS0104 'Button' is an ambiguous reference between 'System.Windows.Forms.Button'
and 'System.Windows.Forms.VisualStyles.VisualStyleElement.Button' Line 52
/////////////////////////////////////////////////////////////
and 'System.Windows.Forms.VisualStyles.VisualStyleElement.TextBox' Line 50
Error CS0104 'Button' is an ambiguous reference between 'System.Windows.Forms.Button'
and 'System.Windows.Forms.VisualStyles.VisualStyleElement.Button' Line 51
Error CS0104 'Button' is an ambiguous reference between 'System.Windows.Forms.Button'
and 'System.Windows.Forms.VisualStyles.VisualStyleElement.Button' Line 52
/////////////////////////////////////////////////////////////
Reservation2 With Input Dialog Box:
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;
using static System.Windows.Forms.VisualStyles.VisualStyleElement;
namespace Apartment_Management
{
public partial class Reservation2 : Form
{
public Reservation2()
{
InitializeComponent();
}
private void Reservation2_Load(object sender, EventArgs e)
{
this.reservationTableAdapter1.Fill(this.aMS_2007DataSet.Reservation);
}
private void Move_In_Click(object sender, EventArgs e)
{
string value = "";
if (InputBox("Dialog Box", "Please enter the date that the tenant will move in.", ref value) == DialogResult.OK)
{
labelResponseInput.Visible = true;
labelResponseInput.Text = "Your name: " + value;
}
DialogResult InputBox(string title, string promptText, ref string Input_Value)
{
Form form = new Form();
Label label = new Label();
TextBox textBox = new TextBox(); //ERROR CS104
Button buttonOk = new Button(); //ERROR CS104
Button buttonCancel = new Button(); //ERROR CS104
form.Text = title;
label.Text = promptText;
buttonOk.Text = "OK";
buttonCancel.Text = "Cancel";
buttonOk.DialogResult = DialogResult.OK;
buttonCancel.DialogResult = DialogResult.Cancel;
label.SetBounds(36, 36, 372, 13);
textBox.SetBounds(36, 86, 700, 20);
buttonOk.SetBounds(228, 160, 160, 60);
buttonCancel.SetBounds(400, 160, 160, 60);
label.AutoSize = true;
form.ClientSize = new Size(796, 307);
form.FormBorderStyle = FormBorderStyle.FixedDialog;
form.StartPosition = FormStartPosition.CenterScreen;
form.MinimizeBox = false;
form.MaximizeBox = false;
form.Controls.AddRange(new Control[] { label, textBox, buttonOk, buttonCancel });
form.AcceptButton = buttonOk;
form.CancelButton = buttonCancel;
DialogResult dialogResult = form.ShowDialog();
value = textBox.Text;
return dialogResult;
}
}
}
}