Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  HOME    TRACKER    Visual Basic

Using Ambient Properties In Activex

I am trying to write an activex control. It needs to know the name that the end user has given it. I am trying to use this


but I can't get it to work, can anyone help please?

Best Regards


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
How Do I Access Ambient Properties In Class Modules?
I'm trying to write a class module that accesses data over a CORBA network.

This will be used to support several UserControls that will actually display the data. What I want to do is prevent the support class from trying to make its connections at design time. I initially tried code in this form

If Ambient.UserMode then
' do stuff that accesses the network
End If

This compiles OK, but throws an "object variable or With block variable not set" error when it's called.
Is there a way to do this?

I could just bite the bullet and get one of my controls to set a global bUserMode flag, but that's not really very OO...

Changing Properties Of An Activex From Another Activex Object VB6
I want to change the properties of an ActiveX object written in VB6 from another ActiveX object written in VB6. Both of these ActiveX objects are located on a third ActiveX object. I can do it easily when both ActiveX objects are on a ActiveX container by using parent.object_name.property_name = true. I know you probably think it isn't necessary to put two ActiveX objects on an ActiveX but in this case it really is.

Edited by - rebortne on 7/6/2005 8:12:40 PM

Ambient Lights In Dx7
i am try'n to make a 2d game in dx7, and was wondering how easy it would be to add lighting effects... or am i better off trying to figure out dx8?

if it is possible to do, let me know... i dont know how to make the lights effect the surfaces. maybe because you cant...

if not, where are there good dx8 tutorials for 2d gaming... i havent really found any... i checked directx5vb, but it seems they are more 3d oriented.

anyhelp would be very appreciated, and if anyone has a dx8 scrolling map tutorial, app, anything i can learn from i would be very appreciated...

thanks alot.

I'm using Ambient.UserMode in the ReadProperties of a user control to determine whether the project is in run mode or design mode, and it works OK. However I also have sub user controls, i.e. user controls contained within other user controls, and Ambient.UserMode in them is always True, whether in run mode or design mode.

I understand that True is the default value for Ambient.UserMode for containers that don't provide the Ambient object/properties. So I need to do this with my higher level user control, presumably just by passing its own Ambient.UserMode value along. But how do I do this?

Ambient UserMode
dear all,

can someone tell me how to retrieve an ambient usermode of an usercontrol's parent?

this works in an usercontrol:

VB Code:

however this does not:

VB Code:
can someone tell me why and what can i do to have this information?

thank you,


Help-Ambient Property

I am trying to use Ambient.displayname in an Activex but it keeps generating an error 'client not available', can anyone tell me what I could be doing wrong please?

Best Regards

ActiveX Properties.

When I add a custom control to a VB Project and try to change some of its properties, I have to type them in manually. I would like to be able to get them to pop up the available options.

An example of this is when you change the Visible Property of a form

Me.Visible = ... (A True / False option will be popped up)

Now if I have a control with a Property called Colour for argument sake, with 3 valid options Red, Green & Blue, How can I make them pop up??

E.g MyControl1.Colour = ... (Red,Green,Blue should pop up !!)

Could this be done for Class modules as well?

Many Thanks.

ActiveX Properties
I've created an ActiveX control with its own properties and stuff, but is it possible for me to make it so that the user using this control can select from a list of possible values that this property can hold?

For example, with the combo box control, the Style property has the values it can hold listed when you select it in the Properties Window.

ActiveX Properties And ASP
How do I pull property values out of an activex control into an asp page. In my vb code of the activex control i have:

Public Property Get UserName() As String
    UserName = msUserName
End Property

How would i retrieve what "UserName" is into my ASP page. Any help would be greatly appreciated.  I can't seem to find any help on this. Thanks

Add Properties To ActiveX DLL
I've checked MSDN, Google, TT forums and FAQs.  I must be searching for the wrong thing.

I'm working on creating an ActiveX DLL and I'd like to create properties for it so I can set properties in code and then execute instead of having to supply a long string of variables when I call a function from it.

Could someone give me a link to some how-to information on creating properties for custom object?

Thanks in advance.

Rott Paws

 ...It's not a bug.  It's an undocumented feature!!!

Accessing Properties Of A ActiveX Control, Inside Other ActiveX Control
I am working with some ActiveX Control with ASP. My question is that "In ASP, how can we access properties of one ActiveX control which is wrapped inside other ActiveX control, so that threw those properties we can intract with Server Side" Please help me and reply at your earliest.


Sounds And Ambient Music
How do you make it so that when ever a function is called such as cmd1_click, VB will play a *.wav file?
And another question: How can you make ambient form music?
Some code examples would be preferred, along with an explanation. Thanks!!

Can't Get Rid Of Ambient Lighting In Scene
I have removed all light code and am working with basic geometry in my game, but directx doesn't want to render absolute black. Even completely unlit geometry appears very faintly. Does DirectX have some sort of global small ambience that I must override? How can I get the unlit polygons genuinely black?

Sound (ambient And Effect)
Hi, i'm trying to get sounds to play while the program is running.
There's an ambient sound that must loop until the program quits, and there are sounds (effects) which will play at random intervals. I'm using this...

Option Explicit

Private Const SND_ASYNC = &H1 ' play asynchronously
Private Const SND_FILENAME = &H20000 ' name is a file name
Private Const SND_LOOP = &H8 ' loop the sound until next sndPlaySound
Private Const SND_PURGE = &H40 ' purge non-static events for task

Private Declare Function PlaySound Lib "winmm.dll" Alias "PlaySoundA" ( _
ByVal lpszName As String, _
ByVal hModule As Long, _
ByVal dwFlags As Long _
) As Long

Private Sub form_load()
End Sub

Private Sub Form_Unload(Cancel As Integer)
PlaySound vbNullString, 0&, SND_PURGE
End Sub

...for the ambient sound. The problem is.. how can I play another sound
at the same time without stopping or disrupting the ambient sound?

thanks in advance

ActiveX Control Properties
I'm trying to pass property values from my HTML to my ActiveX Control using the PARM tag. When I code my Get and Let property routines, how do I code it to accept the properties from the PARAM tag? Here is the code in my HTML and my ActiveX Control. Thanks in advance for your help.

<OBJECT id=EXTVEN classid=clsid:61ACS664-333A-45CC-Bd43-0D95B7Ap087C>
<PARAM NAME='strLoginID' VALUE="MyLoginID" >
<PARAM NAME='strPassword' VALUE="MyPassword">
<PARAM NAME='strExtranetURL' VALUE="">

Public Property Get strLoginID() As String
strLoginID = something
End Property

Public Property Let strLoginID(myVar As String)
something = myVar
End Property

Public Property Get strPassword () As String
strLoginID = something
End Property

Public Property Let strPassword(myVar As String)
something = myVar
End Property

Public Property Get strExtranetURL() As String
strLoginID = something
End Property

Public Property Let strExtranetURL(myVar As String)
something = myVar
End Property

Setting ActiveX Properties
I'm a newcomer to using the API but it would appear to me that it may be possible to set a property of an ActiveX component embedded in an application from another application. If it is I could do with some hints. The situation I have is as follows.

The activeX component is MapX (from MapInfo) which adds a map to a form, two of the properties are: Map1.CenterX and Map1.CenterY which when set recenter the map object. I want to be able to set these properties from another application (basically a database front-end containing X, Y pairs), is this possible?

Thanks in anticipation of your help


Setting ActiveX Properties
im coding a button control for a program of mine, and i was wondering, i wanted to make a property on it so when i click the button, it changes color to what i set in the property. can anyone make an example of this?

ActiveX Run-time Only Properties
dear all,

how can we define some properties of a custom UserControl so that they are only accessible at run-time and NOT at design time?

thank you,


Properties Of ActiveX Object

How can we know the properties of an AciveX object added to the pplication using CreateObject? For example when an Excel object is created using CreatePbject("Excel.application"), how do we know the propeties of Excel applicaton?

VB is not giving help on F1 for these. Any help?


Assigning Activex Properties
I created a vb6 activex control compiled into an ocx for a generic ms outlook task send. So I want to use this on an page...
compiled the ocx added it to my page....
Now I have this:

<form id="Form1" method="post" name="form1" runat="server">
<input type="button" name="cmdDoIt" onclick="doStuff()" style="Z-INDEX: 101; LEFT: 96px; WIDTH: 88px; POSITION: absolute; TOP: 88px; HEIGHT: 24px">
<OBJECT id="myActiveX1" style="Z-INDEX: 102; LEFT: 224px; POSITION: absolute; TOP: 232px"
classid="clsid:CD116C7E-1D49-4B29-9660-68B715DEB4CD" name="myActiveX1"
<PARAM NAME="_ExtentX" VALUE="8467">
<PARAM NAME="_ExtentY" VALUE="2381">

So my active x control is called myActiveX1. Inside of this active x component i have properties to store:

The subject of the task
The body of the task
And the person receiving the task

I tried using jscript and vbscript to assign these properties on the page on a client side html button. Not all. If I create a button directly on the activex control and set the properties that works fine. But I cannot have this because I need to read in the person receving the task, the subject, and the body from the web page. Meaning these are controls on the in jscript Id like to call sometihng like:

myActiveX1.Subject = "blah"

But I tried everything

form1.myActiveX.Subject = "blah"

where form1 is my web form...still no luck....

Can anyone point me to some help


ActiveX Control Properties
I used the wizard to add properties to my control but when when I put them in I don't get the drop-down color menu or the alignment choices dropdown. How can I fix this?

Change Properties From ActiveX
How can I change properties of commandbutton (Enabel, disable ...) from an ActiveX ?

ActiveX Control Properties
I am placing the MS activeX Calendar on our web page. I would like a user to click a date on the calendar and then, I would pop up the events for that day. Can anyone tell me how to retrieve the day the user clicked? I see the value param but when I try to read it I keep getting a Script error. I am new to this and probably not using the proper sytax to return the value. Can someone tell me how to retireve the values from an activeX control such as the one described above? Thanks

Exposing Activex Properties

How can I expose a property like Font of a constituent control in Visual Basic which itself is a control?


Font Properties For ActiveX Component

I'm wondering how to manage font property into an activeX control. I was hoping it's almost the same as managing color with ole_color. Unfortunately, ole_font doesn't exist. So how can I do that ?

Public Property Get BackColor() As OLE_COLOR

Thanks for your help

Add Properties To An Existing ActiveX Ctrl
I have an ActiveX ctrl.
I have to add new properties and hide some of the original properties.
Please guide me

Exposing An ActiveX Objects Properties
Hi everyone, I'm not sure if I'm posting this in the correct section but, I was wondering if anyone knows how to expose an ActiveX DLL Objects funtions and properties through Visual Basic code. I'm trying to find out what properties are avaliable just by the objects name, and also what the object's properties are (such as GET, LET, function, sub, etc). Any help on this would be greatly appreciated. I hope my description of this isn't too confusing.

Grouped Properties For Activex Control
How can I create grouped properties for an activex control

for ex:

UserCtl.Group1.Prop1 = ""
UserCtl.Group1.Prop2 = ""
UserCtl.Group1.Prop3 = ""

UserCtl.Group2.Prop1 = ""
UserCtl.Group2.Prop2 = ""

any sample code would be great

thanks in advance

Adding Properties To ActiveX Controls
I am playing around with ActiveX controls and adding new properties for the control. I can add properties defined as boolean, string and integer. What I want to be able to do is add a property that appears as a selection list (dropdown list box) in the properties window when the new ActiveX control is placed on a form.

This has got to be a piece of cake for someone. I just don't want to spend a bunch of time digging for the answer. I have a few ideas (property array? -- indexedvalue??), but don't want to spend too much time digging.


How To Know What Properties Embedded In An Activex Object
I am always curioused.
For a while I browse this forum, I came accross some threads
regarding activex object such as excel and word objects.
I wonder how you all know all the properties and functions
for that particular object.

Someone told me to get a reference file for the object, but
where I am to get it for Excel and Word?

I know it's but any specific website for me
to grab a reference about Excel and Word object's properties
and functions?

Desperated, pls.


ActiveX Control Properties Problem
I'm makeing a simple control that adds or subtracts from a textbox when you press a comand button either side the code so far is:

Dim PlusMinusStr As Integer
Dim Num1 As Integer
Dim Num2 As Integer

Public Property Get PlusMinusAmount() As Integer
PlusMinusAmount = PlusMinusStr
End Property

Public Property Let PlusMinusAmount(ByVal NewPlusMinusAmount As Integer)
PlusMinusStr = NewPlusMinusAmount
End Property

Private Sub MinusButton_Click()

Num1 = PlusMinusTxt.Text
If Num1 > 0 Then
PlusMinusTxt.Text = Num1 - PlusMinusAmount
End If

End Sub

Private Sub PlusButton_Click()

Num2 = PlusMinusTxt.Text
PlusMinusTxt.Text = Num2 + PlusMinusAmount

End Sub

My problem is that the property PlusMinusAmount which determins how much is added or subtracted wont hold its setting at runtime, it appears in the property list and you can chainge it but when I run it it loses the setting.


Dynamic Activex Properties Array
First of all, i'm a beginner.
To simplfy, I'm tryng to develop an activex control wich will have a dynamic number of lines defined by the end user during his form design time. So when the end user places an instance of my control on his form he must be able to define the number of lines he desires and also the relative positions of the lines inside the control (a 2 dimension array [line index, relative position]. The end user should also be able to access this properties(?) in his code, so that if he places two instances of the control with diferent numbers of lines he could then refer to the controls lines in his form code like "control1.line(n).relative position = xxx" .

Is this possible?


Hiding Methods, Properties From ActiveX Dll.
When I want to hide COM method, properties to be seen by a COM container in Visual C++, I use hidden keyword.


[id(1),helpstring("Outsider's would never know it."),hidden] HRESULT DoNothing();

Is there anyway to do the same in Visual Basic 6 ActiveX Dlls?

How Can We Access Properties Of Activex From A Form
I declared a get property in activex xyz
in form 1:
-i declared
dim control as usercontrol

in form load trying to access get property....
but I am getting object not set....
can someone help?
below is the code sample...

Option Explicit
Dim TreeControl As usercontrol
rivate Sub Command1_Click()

Dim sJobNo As String
sJobNo = TreeControl.JobNo - here i am getting as object not set
End Sub

ActiveX Properties - Array With Structure
My control needs to Add, Edit & Delete properties much like a toolbar properties (Caption, image, Group, etc).
I guess I have to use a Type and Array declaration of that type.
How is this done on the property page?
Where is the actual data stored ?
Will all the entries in the array be stored at once or would it be one by one ?

Your help is appreciated.

Properties Dialog For ActiveX Control
Hi guys,

I am new to this ActiveX area. What i want to do is a seperate properties dialog box
for my activex control. I want to use this control on the web. Is it possible in
VB to create a property dialog ( property bag ?? ) for my activex control? Currently
i have a C++ idl file which contains several interfaces. Those interfaces has
been implemented by my activex control. In this way, i could able set some properties
to my activex control in Visual Interdev. But the properties are growing for my
Grid Control. So, it would be nice to have a seperate property dialog for that control.
If any one have done this before, please let me know. Or please point me some direction.


About The Editor Ambient... And Mouse Wheel Scroll
this question is quite unusual cause is not refered to code.
My mouse wheel scroll doesn't work in editor ambient.. there's any way of making it working?

it works at my home pc (without i've done anything particular!)... but here at work it doesn't work...

ActiveX Control Interface Wizard Properties
Whenever I bring up the ActiveX Control Wizard, it has properties, methods, and events from a DBGrid that was the control the first time I used the wizard. I want it to have the stuff for the current control, like a textbox, I am building. How can I get it to see the constituent properties, methods, and events of what I am working on now?

Properties Of Activex Control Being Set Through HTML Page
I am trying to make a simple activex control which contains a label and a shape control .
My intension is to set properties like fillcolor and caption of the label , fill color of the shape and left and top of the usercontrol. I am able to do this when i use this control on a form of another VB project. But I want to do the same from a HTML page.

When run in debug mode, and setting properties through HTML code executes the code but the control does not appear on the browser. The below is my html code
<OBJECT ID="ListControlNet"
<PARAM NAME="Caption" VALUE="Hello"

This code is setting only caption property.

The below my Vb code of the control.
Public Property Let Display(ByVal vNewValue As String)
lblCaption.Caption = vNewValue
End Property

Public Property Let FColor(ByVal vNewValue As ColorConstants)
shCircle.FillColor = vNewValue
lblCaption.ForeColor = vNewValue
End Property

Private Sub UserControl_ReadProperties(PropBag As PropertyBag)
lblCaption.Caption = PropBag.ReadProperty("Display")
'shCircle.FillColor = PropBag.Readproperty("FColor")
'lblCaption.ForeColor = PropBag.Readproperty("FColor")
End Sub

I am looking for help such that I can develop a control whose backcolor, caption properties can be set from html and the control receives this value for loading on the browser.

Ashish Agarwal.

Drop Down Style Properties For ActiveX Controls
That worked great Kedeman - thanx!

ActiveX: How Do You Write To The Description Pane In The Properties Box?
When creating custom properties for ActiveX components, how do you write to the description pane in the properties window?

ActiveX: How Do You Write To The Description Pane In The Properties Box?
When creating custom properties for ActiveX components, how do you write to the description pane in the properties window?

Passing Properties To ActiveX Control From HTML
I'm trying to pass property values from my HTML to my ActiveX Control using the PARM tag. When I code my Get and Let property routines, how do I code it to accept the properties from the PARAM tag? Here is the code in my HTML and my ActiveX Control. Thanks in advance for your help.

<OBJECT id=EXTVEN classid=clsid:61ACS664-333A-45CC-Bd43-0D95B7Ap087C>
<PARAM NAME='strLoginID' VALUE="MyLoginID" >
<PARAM NAME='strPassword' VALUE="MyPassword">
<PARAM NAME='strExtranetURL' VALUE="">

Public Property Get strLoginID() As String
    strLoginID = something
End Property

Public Property Let strLoginID(myVar As String)
    something = myVar
End Property

Public Property Get strPassword () As String
    strLoginID = something
End Property

Public Property Let strPassword(myVar As String)
    something = myVar
End Property

Public Property Get strExtranetURL() As String
    strLoginID = something
End Property

Public Property Let strExtranetURL(myVar As String)
    something = myVar
End Property

Access To Activex Control Properties In Runtime
I would like to know how i can access to the properties of any activex control in runtime.

Thank you in advance

Description Of Custom Properties In Activex Control
How do I add a description to a custom property in an activex control? The control interface wizard allows a property description to be entered, but it does not appear as a prompt when the property is selected in design mode, and has been lost if you enter the wizard again to check.


Can't Alter ActiveX Properties When Added To Web Page.
I have just written my very first ActiveX control component with Visual Basic.
It works when loaded into a Visual Basic program. (I can read and write (Get/Let) the properties)

It also works on a web page BUT if I try to alter the properties with the PARAM tag,
I get the error message;

| Some software (ActiveX controls) on this page might be
| unsafe. It is recommended that you not run it. Do you
| wand to allow it to run?
| Yes / No


Some properties are set to the new value but some don't.
Also trying to alter some will it from working.
Please see;

Do you think it is a problem with my HTML code or the code that created my ActiveX component.

I've used the following Visual basic code in my ActiveX component;

Public Property Get ClockHourType() As ClockHourType
ClockHourType = MyHourType
End Property

Public Property Let ClockHourType(SetHourType As ClockHourType)
MyHourType = SetHourType
PropertyChanged "ClockHourType"
End Property

And the following code in my web page;

&lt;OBJECT ID="MarksClock" WIDTH=73 HEIGHT=33 CLASSID="CLSID:C32A6D4D-3067-11D5-A399-98D604637A36"

&lt;PARAM NAME=ClockHourType VALUE=-1&gt;&lt;!-- 0=h_12, 1=h_24 --&gt;
&lt;PARAM NAME=ClockDigitColor VALUE=&H00000000&gt;
&lt;PARAM NAME=ClockDisplayFont VALUE="Comic Sans MS"&gt;


Also can anybody recommend any good books on ActiveX written with Visual basic?

Mark Agius (


How To Remove Default Properties And Events From An ActiveX Control?

I want to remove the default properties and events from an ActiveX control that I make.
Whenever you create an ActiveX, it adds many properties and events by default which are given below:



I want a clean ActiveX control with only properties and events of my own and do not want these default properties. I thought "VB ActiveX Control Interface Wizard" will do this but it didn't do this either.

Any thoughts?

ActiveX User Control Properties @ Design Time
How do I give the user a drop to menu (similar to the apperance, 3d or flat?) property for my own usercontrol. Ie when a user is using it at design time I want to present them with a drop to box of options to select in the properties box. Any ideas?


How To Pass Custom Properties With An ActiveX Control That Will Allow Developer To...
To the best of my knowledge, the only way to get to the variables is to use the IDT_Extensibility object model which is used for addins. That will let you get the vars etc. The down side is that I don't think it can be easily implemented in an actiovex control.

Alternatively, you could look through the .bs and .frm files using standard file I/O.

- gaffa

Copyright 2005-08, All rights reserved