PDA

View Full Version : [C#]Problema con form


Kleidemos
19-01-2003, 14:19
Sto cercando di realizzare questo progetto (http://forum.hwupgrade.it/viewtopic.php?t=381388).
Sono arrivato qui:

using System;
using System.Windows.Forms;

namespace WinMxAvverter
{
class MainForm : Form
{
private System.Windows.Forms.Button button;
private System.Windows.Forms.TextBox textBox;
public MainForm()
{
InitializeComponents();
}


/// <summary>
/// This method is used in the forms designer.
/// Change this method on you own risk
/// </summary>
void InitializeComponents() {
//
// class MainForm
//
this.SuspendLayout();
this.Name = "MainForm";

//
// textBox Chi
//
textBox = new System.Windows.Forms.TextBox();
textBox.Name = "textBox";
textBox.Text = "textBox";
textBox.Location = new System.Drawing.Point(88, 16);
textBox.TabIndex = 1;
this.Controls.Add(textBox);

//
// Bottone Controlla
//
button = new System.Windows.Forms.Button();
button.Name = "button";
button.TabIndex = 0;
button.Text = "button";
button.Location = new System.Drawing.Point(104, 72);
button.OnClick(ControllaUtenti(textBox.Text));
this.Controls.Add(button);
this.Text = "This is my form";
this.Size = new System.Drawing.Size(300, 136);
this.ResumeLayout(false);
}
public void ControllaUtenti(string nome){ /* Se ha qualcosa */
string chi = nome;
/// <summary
/// Deve creare una funzione che con una MsgBox dica se
/// l'user selezionato è online
/// </summary>
}
public void ControllaUtenti(){ /* Se vuoto */
/// <summary
/// Deve creare una funzione che con una MsgBox dica se
/// nessun user è stato selezionato
/// </summary>
}

[STAThread]
public static void Main(string[] args)
{
Application.Run(new MainForm());
}
}
}


Cosa devo mettere per far comparire nella funz ControllaUtenti() una MsgBox che mi dica quello specificato nel corpo della funzione stressa????????




Tnk