yanis7518
Messages postés283Date d'inscriptionmercredi 7 décembre 2005StatutMembreDernière intervention 9 juillet 2010
-
31 janv. 2006 à 11:52
MorpionMx
Messages postés3466Date d'inscriptionlundi 16 octobre 2000StatutMembreDernière intervention30 octobre 2008
-
31 janv. 2006 à 16:56
Salut a tous
voila je voudrai savoir si il est possible de modifier la valeur d'une textbox à partir d'une fonction appartenant a une class. Et si oui comment???? (1 exemple svp)
merci d'avance
voila mon code :
<HR>
fichier test.cs
namespace Test
{
class
Test
{
string path =
Environment.CurrentDirectory +
"\";
public
void Run()
{
// traitement
//modification de txtBox.Text
}
}
}
fichier Form1.cs
namespace Test
{
public
partial
class
Form1 :
Form
{
private
delegate
void
UPDTXTBOX(
string val);
private
void UpdtTXTbox(
string val)
{
this.txtBox.Text = val;
}
void UpdtTXTBox(
string val)
{
BeginInvoke(
new
UPDTXTBOX(UpdtTXTbox),
new
object[] { val });
}
private
delegate
void
UPDTCTRL(
bool etat);
private
void UpdateCtrl(
bool etat)
{
this.Launch.Enabled = etat;
}
void BtnEnable()
{
BeginInvoke(
new
UPDTCTRL(UpdateCtrl),
new
object[] {
true });
}
void BtnDisabled()
{
BeginInvoke(
new
UPDTCTRL(UpdateCtrl),
new
object[] {
false });
}