Hi, I'm new to C# and the C family languages. I would like to know how I can expose the Show() & Hide() from the Form class to COM. Currently, I have an interface and a class that inherits Form and this interface. More specifically, how do I implement the Show() & Hide()? I know how to do Property1 because it's my property, but Show() & Hide() are from the Form class and I don't know where or how to implement it. Thanks in advance.
---------------------------
[GuidAttribute("3C1565B0-29B8-448e-B7AD-D36362989640")]
[InterfaceType(ComInterfaceType.InterfaceIsDual)]
[ComVisible(true)]
public interface IMyInterface
{
void Hide(); // is this correct?
void Show(); // is this correct?
bool Property1 {get; set;}
}
[GuidAttribute("E6B3EFC1-527A-4024-862F-5588F34BF28F")]
[ClassInterface(ClassInterfaceType.None)]
[ComVisible(true)]
public class SplashForm : Form, IMyInterface
{
public SplashForm()
{
public bool Property1
{
get { return tmrShowSplash.Enabled; }
set { tmrShowSplash.Enabled = value; }
}
}
}
---------------------------
[GuidAttribute("3C1565B0-29B8-448e-B7AD-D36362989640")]
[InterfaceType(ComInterfaceType.InterfaceIsDual)]
[ComVisible(true)]
public interface IMyInterface
{
void Hide(); // is this correct?
void Show(); // is this correct?
bool Property1 {get; set;}
}
[GuidAttribute("E6B3EFC1-527A-4024-862F-5588F34BF28F")]
[ClassInterface(ClassInterfaceType.None)]
[ComVisible(true)]
public class SplashForm : Form, IMyInterface
{
public SplashForm()
{
public bool Property1
{
get { return tmrShowSplash.Enabled; }
set { tmrShowSplash.Enabled = value; }
}
}
}