Control Names (collection) & 2004 dwg ocx

Control Names (collection) & 2004 dwg ocx

Anonymous
Not applicable
282 Views
5 Replies
Message 1 of 6

Control Names (collection) & 2004 dwg ocx

Anonymous
Not applicable
------- 1 --------
I am trying to loop through all the controls in a frame and if they are not
lables then set some properties, but how do I test the control type ?

Dim oCrl As Control

For Each oCrl In frame1.Controls
If ocontrol <> ??label?? Then
oCtrl.xxx
End If
Next

replace ??label?? with... ?

------- 2 --------
Is there somewhere I can get the ocx Drawing Preview control for acad 2004 ?

(I have seen the code on http://code.acadx.com reguarding this preview
through API calls rather then the control, but I prefer to have the control)


Thanks
0 Likes
283 Views
5 Replies
Replies (5)
Message 2 of 6

Anonymous
Not applicable
"Brian McCavour asked"
> I am trying to loop through all the controls in a frame and if they are
not
> lables then set some properties, but how do I test the control type ?

There's probably a better way, but a quick hack would be to use the 'Tag'
property of the label control - add something like 'Label', then look for it
in your loop.

Private Sub Command2_Click()
For Each Control In Form1.Controls
If UCase(Control.Tag) <> "LABEL" Then
MsgBox "Gotcha!"
End If
Next
End Sub

As far as ?#2, I can't answer that one. I believe there used to be a
Thumbnail Viewer out there, but I don't know if 2004 has one.

Good Luck,

Scott
0 Likes
Message 3 of 6

Anonymous
Not applicable
Ahh yes, such a simple yet effective work-around thanks !

I saw a preview ocx for acad 2000, but when I tried to use it all I got was
black box, so im thinking the new 2004 file format has changed that, was
hoping for a new control.




"LochDhu" wrote in message
news:5CE12CE3FBAABD77810E54E2958FF410@in.WebX.maYIadrTaRb...
> "Brian McCavour asked"
> > I am trying to loop through all the controls in a frame and if they are
> not
> > lables then set some properties, but how do I test the control type ?
>
> There's probably a better way, but a quick hack would be to use the 'Tag'
> property of the label control - add something like 'Label', then look for
it
> in your loop.
>
> Private Sub Command2_Click()
> For Each Control In Form1.Controls
> If UCase(Control.Tag) <> "LABEL" Then
> MsgBox "Gotcha!"
> End If
> Next
> End Sub
>
> As far as ?#2, I can't answer that one. I believe there used to be a
> Thumbnail Viewer out there, but I don't know if 2004 has one.
>
> Good Luck,
>
> Scott
>
>
>
0 Likes
Message 4 of 6

Anonymous
Not applicable
Brian McCavour wrote:
> ------- 1 --------
> I am trying to loop through all the controls in a frame and if they
> are not lables then set some properties, but how do I test the
> control type ?


If Not ocontrol TypeOf Is Label Then
0 Likes
Message 5 of 6

Anonymous
Not applicable
Frank Oquendo wrote:

> If Not ocontrol TypeOf Is Label Then

Typo alert!

If Not TypeOf ocontrol Is Label
0 Likes
Message 6 of 6

Anonymous
Not applicable
Perfect, thanks again !


"Frank Oquendo" wrote in message
news:4EEFD4E761FD11468C0492B8A1FC3C3A@in.WebX.maYIadrTaRb...
> Frank Oquendo wrote:
>
> > If Not ocontrol TypeOf Is Label Then
>
> Typo alert!
>
> If Not TypeOf ocontrol Is Label
>
>
>
>
0 Likes