Windows Develop Bookmark and Share   
 index > Windows Forms Designer > Dragging ActiveX Control in the Designer Area which needs a License Key
 

Dragging ActiveX Control in the Designer Area which needs a License Key

Hi,

I have created an custom Designer app which has tool box and design surface. In my tool box i have some activex component ,when i drag and drop those components to the designer area then it creates those controls in my design area,but when the activex control is a having runtime license then when i am drag and drop the control to the design area it asks for licenseso i followed the typical procedure of runtime license for activex control

System.Reflection.FieldInfo f = typeof(AxHost).GetField("licenseKey", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);

f.SetValue(this, "{xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx}");

but still it asks for the license.

i tried simple sample of

public class Class1 : OriginalActivexControl

{

public Class1()

{

System.Reflection.FieldInfo f = typeof(AxHost).GetField("licenseKey", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);

f.SetValue(this, "{C5412DDA-2E2F-11D3-85BF-00105AC8B715}");

}

}

}

in my form load i did the following

Class1 obj = new Class1();

Controls.Add(obj);

obj.Left = 100;

obj.Top = 10;

obj.Width = 275;

obj.Height = 275;

obj.Show();

it works fine...

but if i do the same thing in my designer application it fails pls let me know how to do solve this issue

regards

LongHorn7

LongHorn7  Wednesday, August 08, 2007 2:27 PM
Karthikeya Pavan Kumar .B  Thursday, August 09, 2007 10:01 AM
Karthikeya Pavan Kumar .B  Thursday, August 09, 2007 10:01 AM

You can use google to search for other answers

Custom Search

More Threads

• TextBox
• Menu Button (outside of a toolbar)
• Tabs Per Row
• How to add custom attribute to member declaration using CodeDOM
• Making a dataGridView with more "columns"
• Multiple Forms
• Forcing a control to appear in the Component Tray...
• Why is button not showing with rounded edges?
• How to set component's property value at DesignVerb click event?
• Invoke Design Time Editor from own code.