DesignerVerbCollection

F

Franck Diastein

Hi, I have a component using DesignerVerbCollection. When one of the
verbs is clicked in VS, I launch a WinForm...

The structure of my component is this:

Component.cs (component code and Designer code)
frmOptions.cs (a properties form for component)
ComponentLogic.cs (a single class with the object)

When a Component is used, a ComponentLogic is declared this way:

public ComponentLogic myLogic = new ComponentLogic();

I don't know how to access myLogic from Designer class to send it to
frmOptions when a verb is clicked...

I know this is hard to understand, but basically my question is how to
make myLogic accesible from Designer class...

TIA
 
G

Guest

Overload the default constructor made buy the designer. Get myLogic as a
parameter:
public class frmOptions
{
private ComponentLogic m_myLogic;
Public frmOptions(ComponentLogic myLogic)
{
m_myLogic = myLogic;
}
}

When you create a new instance of frmOptions:
frmOptions frm = new frmOptions(myLogic);
 
F

Franck Diastein

It's what I do in my frmOptions...

How to get myLogic created in Component from Designer to pass it to
frmOptions ?

My main problem is that Component and ComponentDesigner are 2 different
classes... I don't know how to retreive myLogic from ComponentDesigner...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top