So this is a both a general and very specific question: My client has a vb6 project migrating to vb.net as does not want to upgrade to a new component. This is with respect to VSPrinter. I can import the lib no problems and it works. Code: Imports VSPrinter8Lib And then Dim VS As New VSPrinter With VS etc.. End With I can access all properties and all good. But… When it fires a NewPage() I have no way of trapping that method. How do I do that? If I create a form and drop the ocx on it I can get that Private Sub VS_NewPage(sender As Object, e As EventArgs) Handles VS.NewPageEvent MsgBox("J") End Sub But then I can’t use VS.Picture = VS.LoadPicture(etc) to bring in an image.
I think I am missing how to load an ocx library an get at the methods programmatically. Any help would be greatly appreciated
Thanks!
You need to create a form, add
VsPrinteras an OCX component, then do this:This is different than VB6
LoadPicture. You also need to passByRefyour initial call to any sub call. So, as an example, on your form load, if you want to call a routine that loads a picture you firstand then create a call
GetCoLogo(Me.VS)to