From: charley on
Hello

I want to subclass a maskedbox and use it in a class that instantiates
a MSHFlexgrid. See the code below. I keep having an error in the last
line of the code: type mismatch. Does anybody know what's wrong?
Thanks


private strMbName as string
private with events fg as MSHFlexgrid
private with events Mb as maskedbox

sub test
strMbName = "mbFgEdit1"
Call Licenses.Add("MSMASK.MaskEdBox")
fg.Parent.Controls.Add "MSMask.MaskEdBox", strMbName,
fg.Container
Set Mb = fg.Parent.Controls(strMbName)
end sub
Charley
From: C. Kevin Provance on
It would be helpful if you had cut and past the actual code instead of approximating it. No Dim statements were included. Without knowing what they are, it's anyones guess what the problem is.

--
2025
If you do not believe in time travel,
your beliefs are about to be tempered.

http://www.facebook.com/group.php?gid=43606237254
"charley" <csvanderwerf(a)planet.nl> wrote in message news:1959cc0a-8d44-42c6-bf9c-a921193849dd(a)e1g2000yqh.googlegroups.com...
: Hello
:
: I want to subclass a maskedbox and use it in a class that instantiates
: a MSHFlexgrid. See the code below. I keep having an error in the last
: line of the code: type mismatch. Does anybody know what's wrong?
: Thanks
:
:
: private strMbName as string
: private with events fg as MSHFlexgrid
: private with events Mb as maskedbox
:
: sub test
: strMbName = "mbFgEdit1"
: Call Licenses.Add("MSMASK.MaskEdBox")
: fg.Parent.Controls.Add "MSMask.MaskEdBox", strMbName,
: fg.Container
: Set Mb = fg.Parent.Controls(strMbName)
: end sub
: Charley
From: charley on
On 19 mrt, 16:57, "C. Kevin Provance" <*@*.*> wrote:
> It would be helpful if you had cut and past the actual code instead of approximating it.  No Dim statements were included.  Without knowing what they are, it's anyones guess what the problem is.
>
> --
> 2025
> If you do not believe in time travel,
> your beliefs are about to be tempered.
>
> http://www.facebook.com/group.php?gid=43606237254"charley" <csvanderw....(a)planet.nl> wrote in messagenews:1959cc0a-8d44-42c6-bf9c-a921193849dd(a)e1g2000yqh.googlegroups.com...
>
> : Hello
> :
> : I want to subclass a maskedbox and use it in a class that instantiates
> : a MSHFlexgrid. See the code below. I keep having an error in the last
> : line of the code: type mismatch. Does anybody know what's wrong?
> : Thanks
> :
> :
> :  private  strMbName as string
> :  private with events  fg as MSHFlexgrid
> :  private with events Mb as maskedbox
> :
> : sub test
> :       strMbName = "mbFgEdit1"
> :       Call Licenses.Add("MSMASK.MaskEdBox")
> :       fg.Parent.Controls.Add "MSMask.MaskEdBox", strMbName,
> : fg.Container
> :       Set Mb = fg.Parent.Controls(strMbName)
> : end sub
> : Charley

Hello Kevin

I took out that part of the code that caused the problem.
But I also saw that the code was not exactly right.
I am sorry for that. Here is the important part of code of the class
again
In the line with the following code: Set Mb =
fg.Parent.Controls(strMbName)
i get the error message: type mismatch


Private WithEvents fg As MSHFlexGrid
Private WithEvents Tb As TextBox
Private WithEvents Mb As MaskEdBox

Private strTbName As String
Private strMbName As String

Public Property Set StartFlexGridControl(fgControl As MSHFlexGrid)
Set fg = fgControl
fg.GridLines = flexGridNone
'On Error Resume Next
strTbName = "tbFgEdit"
Do
Err = 0
strTbName = strTbName & "1"
fg.Parent.Controls.Add "VB.TextBox", strTbName, fg.Container
Loop While Err <> 0
Set Tb = fg.Parent.Controls(strTbName)
With Tb
.Visible = False
.BorderStyle = m_TbBorderStyle
Set .Font = fg.Font
.TabStop = False
.ZOrder 1
lngOudColumn = 0
End With

strMbName = "MaskEdBox1"
Call Licenses.Add("MSMASK.MaskEdBox")
fg.Parent.Controls.Add "MSMask.MaskEdBox", strMbName, fg.Container
Set Mb = fg.Parent.Controls(strMbName)
With Mb
.Visible = True
.BorderStyle = m_TbBorderStyle
Set .Font = fg.Font
.TabStop = False
.Format = "#0.00"
.ZOrder 0 'zet de tb op de achtergrond, zodat het snelmenu goed
werkt
lngOudColumn = 0
End With
ZoekVariabele = "" 'ínitiele waarde, ondermeer bij het oproepen van
het scherm
End Property