Results 1 to 2 of 2

Thread: [RESOLVED] Making C# usercontrol visible to VB6 application

  1. #1

    Thread Starter
    Member
    Join Date
    Mar 2006
    Posts
    58

    Resolved [RESOLVED] Making C# usercontrol visible to VB6 application

    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:
    Code:
    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
    
    		}

  2. #2

    Thread Starter
    Member
    Join Date
    Mar 2006
    Posts
    58

    Re: Making C# usercontrol visible to VB6 application

    Solved it myself

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width