Re: Creating controls at runtime



You should do it the same way that the Visual Studio Designer does it.
You have a reference to a ListBox, right? Just write the same code that
the Designer would have written:

oObjCMB.SelectedIndexChanged += new
System.EventHandler(CMB_SelectedIndexChanged);

....

private void CMB_SelectedIndexChanged(object sender, System.EventArgs
e)
{
...
}

I believe that Intellisense will even help you write the method header.

.



Relevant Pages

  • Re-POST: How to close forms opened from other workbooks...?
    ... | or reference a listbox item if it is open. ... Prev by Date: ...
    (microsoft.public.excel.programming)
  • DataTables (newbie question)
    ... I've created a DataTable in the visual studio designer. ... anywhere in the documentation that says how to access the data in this data ... Dan. ... Prev by Date: ...
    (microsoft.public.dotnet.languages.csharp)
  • Referencing Form Variables in a Query
    ... I would like to know how to get field values from a query onto fields in the ... I query for two fields in a listbox, where one field goes into the list ... How do I reference a form field in a query? ... Prev by Date: ...
    (microsoft.public.access.forms)

Loading