Function conversion...

cnjmorris

New member
Joined
Sep 20, 2003
Messages
1
Here is the function along with the errors. I tried looking at the error messages and dont understand what is necessary to make this workable.


Public Sub DoGradient(ByRef FormName As Object)
Dim BF As Object
On Error Resume Next
============================================================

============================================================
Dim i, y As Short
UPGRADE_WARNING: Couldnt resolve default property of object FormName.AutoRedraw. Click for more: ms-help://MS.VSCC/commoner/redir/redirect.htm?keyword="vbup1037"
FormName.AutoRedraw = True
UPGRADE_WARNING: Couldnt resolve default property of object FormName.DrawStyle. Click for more: ms-help://MS.VSCC/commoner/redir/redirect.htm?keyword="vbup1037"
FormName.DrawStyle = 6
UPGRADE_WARNING: Couldnt resolve default property of object FormName.DrawMode. Click for more: ms-help://MS.VSCC/commoner/redir/redirect.htm?keyword="vbup1037"
FormName.DrawMode = 13
UPGRADE_WARNING: Couldnt resolve default property of object FormName.DrawWidth. Click for more: ms-help://MS.VSCC/commoner/redir/redirect.htm?keyword="vbup1037"
FormName.DrawWidth = 13
UPGRADE_WARNING: Couldnt resolve default property of object FormName.ScaleMode. Click for more: ms-help://MS.VSCC/commoner/redir/redirect.htm?keyword="vbup1037"
FormName.ScaleMode = 3
UPGRADE_WARNING: Couldnt resolve default property of object FormName.ScaleHeight. Click for more: ms-help://MS.VSCC/commoner/redir/redirect.htm?keyword="vbup1037"
FormName.ScaleHeight = 256
For i = 0 To 510
UPGRADE_WARNING: Couldnt resolve default property of object FormName.Width. Click for more: ms-help://MS.VSCC/commoner/redir/redirect.htm?keyword="vbup1037"
UPGRADE_WARNING: Couldnt resolve default property of object FormName.Line. Click for more: ms-help://MS.VSCC/commoner/redir/redirect.htm?keyword="vbup1037"
FormName.Line((0, y)-(FormName.Width, y + 1), RGB(0, 0, i), BF)
FormName.GetType()
y = y + 1
Next i
End Sub
 
First of all you are trying to use an Object object (:)) for a form where you should use the Form type unless you are casting the object.
Second, when you change the object type to Form those will show errors because those methods/properties from VB6 are not available in .NET.
:)
 
Back
Top