|
-
Sep 9th, 2002, 04:34 AM
#1
Thread Starter
New Member
ActiveX control in design mode
I am making an ActiveX control in a separate project, to compile it into an OCX. Its purpose is to display a graph and have two forms for exporting and printing.
It contains a UserControl for the displaying of the chart, and two forms.
When I include the compiled OCX in the project, I see a regular UserControl icon in the Components toolbox. Can I have my own icon there?
When I put the control on a form I can resize it, but not move it around, as the UserControl reacts to the mouse and keyboard events. How can I stop the UserControl (and the controls on it) to stop doing that? When do I have to add the Ambient.UserControl code?
Thanks!!!
Jerry
-
Sep 10th, 2002, 09:02 AM
#2
PowerPoster
Use the ToolBoxBitamp property of the UserControl to specify your custom image. But remember, the dimension should be 16 X 15 pixels, otherwise it will be scaled to that sized.
Use the Ambient.Usermode to determine if the usercontrol is on the form or not.
VB Code:
If Ambient.Usermode then
'this is run time mode
Else
'this is VB design mode
End If
-
Sep 10th, 2002, 11:08 AM
#3
Thread Starter
New Member
Thanks for the TollBoxBitmap tip!
I knew about the Ambient property, but didn't know where to put it to prevent the whole UserControl to receive events in design mode. I solved the problem by setting all contained controls to Enabled = False.
Thanks!
Jerry
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|