   .net Form Problems...
  I have a problem, I need to send a message in a text box whenever a statement is true. I activate the variable of this statement using a button. However, I can't seem to find a place to put the if statement.Form code example:http://www.developer.com/net/net/article.php/1378751Scroll to bottom.   
  When you say send a message in a text box, so you mean set it to something?if(statement){    textBox1.Text = "Variable is true";}I'm not sure I understand your problem enough to help, sorry.   ;  Basically I need to send the same message over and over and over until a button is clicked to tell it to stop. One button activates a variable, isbutton1down = true... Now I need a loop to put an if statement in it to send the message over and over again.   ;  I dont see the problem?while(blah){ if(variable != true) { display some form of message } else {  break; }}   ;  You don't understand. Using the following code:// This is the main project file for VC++ application project // generated using an Application Wizard.#include "stdafx.h"#using &lt;mscorlib.dll&gt;#include &lt;tchar.h&gt;#using &lt;System.dll&gt;#using &lt;System.Drawing.dll&gt;#using &lt;System.Windows.Forms.dll&gt;#using &lt;System.Data.dll&gt;using namespace System;using namespace System::Drawing;using namespace System::Collections;using namespace System::ComponentModel;using namespace System::Windows::Forms;using namespace System::Data;namespace cs1{   /// &lt;summary&gt;   /// Summary description for Form1.   /// &lt;/summary&gt;public __gc class Form1 : public System::Windows::Forms::Form   {   private: Button* button1; Label* label1; /// &lt;summary&gt; /// Required designer variable. /// &lt;/summary&gt; System::ComponentModel::Container* components;   public: Form1() {    //    // Required for Windows Form Designer support    //    components = NULL;    InitializeComponent();    //    // TODO: Add any constructor code after// InitializeComponent call    // } /// &lt;summary&gt; /// Clean up any resources being used. /// &lt;/summary&gt;   protected: void Dispose( bool disposing ) {    if( disposing )    {  if (components != NULL)   {components-&gt;Dispose();  }    }    Form::Dispose( disposing ); } /// &lt;summary&gt; /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// &lt;/summary&gt;   private: void InitializeComponent() {    button1 = new Button();    label1 = new Label();    SuspendLayout();    //// button1    //button1-&gt;Location = Point(48, 96);    button1-&gt;Name = "button1";    button1-&gt;TabIndex = 0;    button1-&gt;Text = "Greet Me";    button1-&gt;Click += new System::EventHandler(this, &Form1::button1_Click);    //// label1    //label1-&gt;Location = Point(184, 96);    label1-&gt;Name = "label1";    label1-&gt;TabIndex = 1;    //// Form1    //AutoScaleBaseSize =  System::Drawing::Size(5, 13);    ClientSize =  System::Drawing::Size(292, 273);    Controls-&gt;Add(label1);    Controls-&gt;Add(button1);    Name = "Form1";    Text = "Form1";    ResumeLayout(false); }   private: void button1_Click(Object* sender, System::EventArgs* e) {    label1-&gt;Text = "Hello from C++!"; }   };}// This is the entry point for this applicationint __stdcall WinMain(){   Application::Run(new cs1::Form1());    return 0;}Follow the code structure, Form1 runs, InitializeComponent(); initializes, where would the if statement go? I've attempted it myself, after InitializeComponent(), the application displays. While application is executing I need to check if statement handlers are met and act on it.[Edited by - Dave84311 on January 3, 2006 8:48:43 PM];  Is there some way that I could set the button down using .net forms? Not too much experience with them... buttonname->?   ;  Please use source tags.Look up the class for w/e your using, command button or w/e it is on MSDN.  That should answer your question.   ;  Already did, didn't find much.   ;  If I understand you right you want to do something like this:user clicks a button (button1)send a message repeatedlydon't stop until user clicks another button (button2)to do this you'll need to create another thread in the click handler of button1.  the thread proc will send the message and check a variable to see if it should continue or stop sending the message.  in button 2's click handler you can set the variable that the thread proc is looking for.hope this helps.   