G_Evans
asked on
Dynamically loaded ActiveX Control can't be enabled
Hi,
I have an app consisting of a user interface layer, (a series of forms in a standard VB project), a business logic layer, (a series of classes/modules in an ActiveX dll project), and additional user interface controls I have designed myself, (in an ActiveX control project).
The three projects are under development and hence have not been compiled. I am running them as a group project with relevent references defined where necessary.
The ActiveX controls are loaded dynamically at run time, i.e. only when required. (The user accesses one of a number of functions and the relevant screen is loaded as an ActiveX control as a result).
Initially this worked fine but I have done something that prevents the dynamically loaded control from being enabled!!!
The actual code for loading the control hasn't been touched - any clues - is it a project reference/component/proper ties issue?
Here is the routine for loading the activeX control.
****At top of form code*****
' Used to allow dynamic load of user controls
Private WithEvents FL3IF As VBControlExtender
Private FL3IFX As Object
***Name of user control passed to routine in format "projectname.controlname"* **
Private Sub Showscreen(UC_Name As String)
' -- Load a user control and show it
On Error Resume Next ' Tidy Up
FL3IFX.CloseModule
Me.Controls.Remove "DATA"
Set FL3IFX = Nothing
Set FL3IF = Nothing
Set FL3IF = Me.Controls.Add(UC_Name, "DATA")
Set FL3IF.Container = fmeX ' A frame on main form
With FL3IF
.Top = 0
.Left = 0
.Height = fmeX.Height
.Width = fmeX.Width
Set FL3IFX = .object
.Visible = True
.Enabled = True ' ****doesn't work!!!!!****
End With
End Sub
I have an app consisting of a user interface layer, (a series of forms in a standard VB project), a business logic layer, (a series of classes/modules in an ActiveX dll project), and additional user interface controls I have designed myself, (in an ActiveX control project).
The three projects are under development and hence have not been compiled. I am running them as a group project with relevent references defined where necessary.
The ActiveX controls are loaded dynamically at run time, i.e. only when required. (The user accesses one of a number of functions and the relevant screen is loaded as an ActiveX control as a result).
Initially this worked fine but I have done something that prevents the dynamically loaded control from being enabled!!!
The actual code for loading the control hasn't been touched - any clues - is it a project reference/component/proper
Here is the routine for loading the activeX control.
****At top of form code*****
' Used to allow dynamic load of user controls
Private WithEvents FL3IF As VBControlExtender
Private FL3IFX As Object
***Name of user control passed to routine in format "projectname.controlname"*
Private Sub Showscreen(UC_Name As String)
' -- Load a user control and show it
On Error Resume Next ' Tidy Up
FL3IFX.CloseModule
Me.Controls.Remove "DATA"
Set FL3IFX = Nothing
Set FL3IF = Nothing
Set FL3IF = Me.Controls.Add(UC_Name, "DATA")
Set FL3IF.Container = fmeX ' A frame on main form
With FL3IF
.Top = 0
.Left = 0
.Height = fmeX.Height
.Width = fmeX.Width
Set FL3IFX = .object
.Visible = True
.Enabled = True ' ****doesn't work!!!!!****
End With
End Sub
Does the property enabled exist?
Also try to move only the enabled property outside the with statement.
regards,
CJ
Also try to move only the enabled property outside the with statement.
regards,
CJ
What exactly is the error btw?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Sorry to waste your time lads, (&/or lasses).
I had somehow set the frame enabled property to 'false'!
I will return to work, tail firmly between legs!!!!!!
(For the record the .enabled property of the FL3IF object was not a supported one, this was being masked by the error handling - cheers!)
I had somehow set the frame enabled property to 'false'!
I will return to work, tail firmly between legs!!!!!!
(For the record the .enabled property of the FL3IF object was not a supported one, this was being masked by the error handling - cheers!)
That was my second question. Glad you got it working... the frustration is over.. I love it when that happens :)
Cheers mate!
Cheers mate!
The ON ... prevents you from seeing the correct error. See what comes out of it.