FlexGrid on VS 2005

FlexGrid on VS 2005

am 04.04.2008 16:52:18 von Bill B

Hi All

I have an older application that utilizes the old VB6 control FlexGrid.

I would really rather find a way to get my current VS 2005 running the
control rather than try to re-write my application for something other than
FlexGrid. Now that said, I did find this:
http://www.ascentive.com/support/new/support_dll.phtml?dllna me=Msflxgrd.ocx
which at first seem to be the answer. Once I followed the instructions and
installed this ocx the control seemed to be supported after a VS restart. I
was able to compile my program and run it. I made a few cosmetic changes to
a few of the forms then suddenly I got the underline again with the
exclamation mark saying that :
"AxMSFlexGridLib.AxMSFlexGrid is not defined"
The solution VS recommended was to change "AxMSFlexGridLib.AxMSFlexGrid" to
"MSFlexGridLib.MSFlexGrid"
When I do that I then get this
Error 35 Method 'Private Sub FlexGrid1_Click(sender As Object, e As
System.EventArgs)' cannot handle Event 'Public Event Click()' because they
do not have the same signature. C:\vbProjects\Forecast\salesmanagerinput.vb
1365 104 Forecast

And this is with Option Strict Off. Option Strict On is a whole other
animal. I get all the same issue plus I get Late Binding errors on the
FlexGrid rows and columns. Any help either getting the original FlexGrid
control installed and working or getitng through these issues would be
greatly appreciated.

Bill

RE: FlexGrid on VS 2005

am 04.04.2008 18:09:04 von jp2msft

Hey Bill,

Say you keep Option Strict Off and create a shell subroutine that calls the
other.

Rename your FlexGrid1_Click to FlexGrid1_OriginalClick, then write the type
of subroutine the MSFlegGridLib is looking for:

Private Sub FlexGrid1_Click(sender As Object, e As System.Whatever)
FlexGrid1_OriginalClick(sender, CType(e, System.EventArgs))
End Sub

Private Sub FlexGrid1_Click(sender As Object, e As System.EventArgs)
' Your code
End Sub

It is a hack, but I find myself doing that some when trying to port old VB6
to newer .NET.

Hope that helps or at least gives you an idea.

"Bill B" wrote:

> Hi All
>
> I have an older application that utilizes the old VB6 control FlexGrid.
>
> I would really rather find a way to get my current VS 2005 running the
> control rather than try to re-write my application for something other than
> FlexGrid. Now that said, I did find this:
> http://www.ascentive.com/support/new/support_dll.phtml?dllna me=Msflxgrd.ocx
> which at first seem to be the answer. Once I followed the instructions and
> installed this ocx the control seemed to be supported after a VS restart. I
> was able to compile my program and run it. I made a few cosmetic changes to
> a few of the forms then suddenly I got the underline again with the
> exclamation mark saying that :
> "AxMSFlexGridLib.AxMSFlexGrid is not defined"
> The solution VS recommended was to change "AxMSFlexGridLib.AxMSFlexGrid" to
> "MSFlexGridLib.MSFlexGrid"
> When I do that I then get this
> Error 35 Method 'Private Sub FlexGrid1_Click(sender As Object, e As
> System.EventArgs)' cannot handle Event 'Public Event Click()' because they
> do not have the same signature. C:\vbProjects\Forecast\salesmanagerinput.vb
> 1365 104 Forecast
>
> And this is with Option Strict Off. Option Strict On is a whole other
> animal. I get all the same issue plus I get Late Binding errors on the
> FlexGrid rows and columns. Any help either getting the original FlexGrid
> control installed and working or getitng through these issues would be
> greatly appreciated.
>
> Bill
>
>
>
>