hi everyone!!! need help here, how can i pass a string to a class? i have two forms and a class, my 1st form is the main form and the other form is used for assigning to a keyer, this form has a combobox where i will select the keyer i want, after selecting the keyer i will now pass the keyer id/name to my class, this is where im having trouble. help me here please.. thank you...

You can use class properties to do this. A simple example:

public class MyClass
{
  public string MyProperty
  {
    get;
    set;
  }
}
public partial class MyForm: Form
{
  private MyClass myObject;

  public MyForm()
  {
    InitializeComponents();
    myObject = new MyClass();
  }
  
  public void PassString(string str)
  {
    myObject.MyProperty = str;
  }
}

hi everyone!!! need help here, how can i pass a string to a class? i have two forms and a class, my 1st form is the main form and the other form is used for assigning to a keyer, this form has a combobox where i will select the keyer i want, after selecting the keyer i will now pass the keyer id/name to my class, this is where im having trouble. help me here please.. thank you...

U can use properties of the class

This question has already been answered. Start a new discussion instead.