PDA

Click to See Complete Forum and Search --> : [RESOLVED] Making C# usercontrol visible to VB6 application


madsun
Apr 28th, 2007, 01:55 PM
Ok, here we go :)
Ive made a usercontrol in c# wich must work in an vb6 developer enviroment. Ive made the interfaces and all, but i cant figure out howto make the control visible when the vb6 developer does
dim ctrl as GaugeGfx.ctrlGaugeGfx
set ctrl = new GaugeGfx.ctrlGaugeGfx
..and then they need some visibilty to show the control

Any1 can helpme out?


c# code so far:


namespace Gauge_gfx
{
[Guid("CEE936A9-F102-4626-8EF7-DFDFF018892E")]

[InterfaceType(ComInterfaceType.InterfaceIsIDispatch)]
public interface _props //Her lager vi et interface som VB kan "Se" :)
{
[DispId(1)]
string GetText
{get; set;}

}

[Guid("E7E2F620-79E7-4b52-B1D8-A812A3ED8EF3")]
[ClassInterface(ClassInterfaceType.None)]
[ProgId("GaugeGfx.ctrlGaugeGfx")]

public class ctrlGauge_gfx : System.Windows.Forms.UserControl,_props
{

private System.Windows.Forms.Timer timer1;
private System.Windows.Forms.TextBox txtTest;
private System.ComponentModel.IContainer components;

private string m_text;
public string GetText
{
get
{
return m_text;
}
set{
txtTest.Text=value ;
m_text=value;
}
}


public ctrlGauge_gfx()
{
// This call is required by the Windows.Forms Form Designer.
InitializeComponent();
// TODO: Add any initialization after the InitForm call

}

madsun
Apr 28th, 2007, 04:17 PM
Solved it myself :)