Here we discuss the Interactions methods in more general terms.

 

                                  FORM METHODS

 

Views Form/Window Listen to any kind Action being performed and call one of the following methods with respect to the user's action.

 

bullet

string GetControl( )

         This method returns the name of the control where the user clicked a button or entered a value.

          The string matches the value of the name attribute used in the XML specification.

bullet

string GetText (string name)

        Returns the string value of the control which is named. The GetText() method is intended to read

        values entered into the TextBox and ListBox controls or filenames created with the

        OpenFileDialog or SaveFileDialog controls. Additionally, if name refers to a GroupBox control, then

        this  method returns the text attribute of whichever radio button inside the group is checked.

bullet

string GetText (string name, int index)

       This method is used with a ListBox control. It returns the string which is in position index in the

       list. (The first string in the list has index 0.)

bullet

void PutText (string name, string text)

       Displays a string in the named ListBox or TextBox control. When used with a ListBox control,

       the string is appended to the end of the list.

bullet

void PutText (string name, int index, string text)

       Displays a string in the named ListBox control, replacing or creating a string at position index in

       the list.

bullet

void PutImage (string name, string filename)

       Sets the Image attribute of a Button or PictureBox control to be the image obtained from the file

       whose name is provided as the second argument.

bullet

void PutImage (string name, Image img)

          Sets the Image attribute of a Button or PictureBox control.

bullet

int GetValue (string name)

       Returns an integer value from the named control. It is used with the TrackBar and CheckBox          

       controls.

       For CheckBox, the result is 0 for unchecked and 1 for checked.

bullet

void PutValue (string name, int value)

       Stores an integer value into the named control. It is used with ProgressBar, TrackBar and Check-

       Box controls. For a CheckBox, storing zero unchecks the box and storing any other integer causes

       the box to be checked.

<<PREVIOUS   HOME >>