- UID
- 1
- 积分
- 15892
- 精华
- 贡献
-
- 威望
-
- 活跃度
-
- D豆
-
- 在线时间
- 小时
- 注册时间
- 2002-1-3
- 最后登录
- 1970-1-1
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
ActiveX/VBA Technical Newsletter - July 2000
This document is part of AutoCAD VB(A) Newsletter Archive
AutoCAD ActiveX/VBA Technical Newsletter - July 31st. 2000
==========================================================
/Note: Have you missed a Newsletter issue? Visit our Newsletter archive at
the following URL:/
http://adn.autodesk.com/techsupp/techsupp/docs/newsletters.htm
Dear AutoCAD ActiveX/VBA Developer,
Table of Contents:
==================
1 - ADDING & REMOVING CUSTOM CONTROLS AT RUN TIME.
2 - NEW OR UPDATED DEVNOTES.
1 - ADDING & REMOVING CUSTOM CONTROLS AT RUN TIME
=================================================
Question:
How to add & remove custom controls such as DWGThumbnail, Volo View,
Whip etc., at run time in Visual Basic?
Answer:
To add custom controls such as DWGThumbnail, Volo View, Whip etc., at
run time we need to know the control's ProgId. The ProgId can be
obtained from the vendor of the control or by searching through the
registry.
Once the ProgId is known all that is required is to declare a control
object of the type required and add it to the form with the appropriate
ProgId.
Steps to create a sample project in VB
--------------------------------------
1. Create a new Standard.Exe project. Form1 is created by default.
2. Place two command buttons towards the bottom of the form with their
default names, leaving sufficient space at the top of the form for
the control.
3. Add the following code to the code window of Form1.
Private MyCtl As Control
Private Sub Command1_Click()
On Error Resume Next
'DwgThumbnail
'Set MyCtl = Form1.Controls.Add("AUTOCAD.DwgThumbnailCtrl.1", _
"SCtl")
'Whip
Set MyCtl = Form1.Controls.Add("WHIP.WhipCtrl.1", "SCtl")
'VoloView Express
'Set MyCtl = Form1.Controls.Add("AvViewX.AvViewX.1", "SCtl")
' show the test control.
MyCtl.Visible = True
MyCtl.Height = 2000
MyCtl.Width = 2000
'DwgThumbnail
'Change the location as required
'MyCtl.object.DwgFileName = "d:\acad2000\tmp.dwg"
'Whip
'Change the location as required
MyCtl.object.StreamName = "d:\acad2000\model.dwf"
'VoloView
'Change the location as required
'MyCtl.object.src = "d:\acad2000\model.dwf"
End Sub
Private Sub Command2_Click()
On Error Resume Next
'Removes the control
Form1.Controls.Remove "SCtl"
End Sub
Uncomment the appropriate lines if you wish to use DwgThumbnail or Volo
View controls.
NOTE: Do not reference these controls in your VB project and also
please make sure that you have the controls registered properly before
executing the code.
For more information regarding adding controls and accessing the
control's events, please refer to documents Q190670 & Q188577 on the
MSDN CD collection.
2. - NEW OR UPDATED DEVNOTES.
=============================
RENAMING OR COPYING AN ANONYMOUS BLOCK
/cgi-bin/solution.pl?SID=55537
PURGING ANNYMOUS BLOCKS
/cgi-bin/solution.pl?SID=55997
PASSING VARIABLES BETWEEN LISP AND VBA
/cgi-bin/solution.pl?SID=57837
DELETING XDATA
/cgi-bin/solution.pl?SID=56457
CORRESPONDING BLOCKREFERENCE OF AN ATTRIBUTEREFERENCE
/cgi-bin/solution.pl?SID=56037
-----------------------------------------------------------------------------
To subscribe or unsubscribe, go to
http://adn.autodesk.com/techsupp/techsupp/docs/newsletters.htm
-----------------------------------------------------------------------------
You received this message as a result of your registration
on the ADN List Server subscription page. If you no longer wish
to receive these messages, read the next section, How to use this
mailing list.
How to use this mailing list:
You may unsubscribe from this e-mail newsletter, or subscribe to
a variety of other informative e-mail newsletters, by returning
to the ADN List Server subscription page at
http://adn.autodesk.com/techsupp/techsupp/docs/newsletters.htm
and changing your subscription preferences.
Alternatively, from the subscribed account you can send an e-mail to
<Majordomo-partnersys@autodesk.com> with the following command in the
body of your email message:
unsubscribe <list-name>
----------------------------------------------------------------------
Autodesk Developer Network (ADN) information and events:
For information on all ADN topics, please visit:
http://www.autodesk.com/adn
----------------------------------------------------------------------
THIS DOCUMENT IS PROVIDED FOR INFORMATIONAL PURPOSES ONLY. The
information contained in this document represents the current view of
Autodesk Inc. on the issues discussed as of the date of publication.
Because Autodesk must respond to change in market conditions, it
should not be interpreted to be a commitment on the part of Autodesk
and Autodesk cannot guarantee the accuracy of any information
presented after the date of publication.
INFORMATION PROVIDED IN THIS DOCUMENT IS PROVIDED 'AS IS' WITHOUT
WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT
LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE AND FREEDOM FROM INFRINGEMENT.
The user assumes the entire risk as to the accuracy and the use of
this document. This document may be copied and distributed subject to
the following conditions:
1. All text must be copied without modification and all pages must
be included
2. All copies must contain Autodesk's copyright notice and any other
notices provided therein
3. This document may not be distributed for profit
---------------------------------------------------------------------- |
|