Can someone help me re-write VB4 to VB.NET?


K

kurt

I have a program I’ve written in VB-4 and am now trying to re-write in VB..NET 2005
Some of what I can’t seem to figure out is how do I transcribe the following VB-4 code to run in my VB.NET program, any and all help is appreciated.Thank you.
'*************************************************
' Keep within screen viewing
Dim maxNormalWidth As Long, maxNormalHeight As Long
Dim deskArea As RECT
Call SystemParametersInfo(SPI_GETWORKAREA, 0&, deskArea, 0&)
deskArea.Left = ScaleX(deskArea.Left, vbPixels, vbTwips)
deskArea.Top = ScaleY(deskArea.Top, vbPixels, vbTwips)
deskArea.Right = ScaleX(deskArea.Right, vbPixels, vbTwips)
deskArea.Bottom = ScaleY(deskArea.Bottom, vbPixels, vbTwips)
maxNormalWidth = (deskArea.Right - deskArea.Left)
maxNormalHeight = (deskArea.Bottom - deskArea.Top)
If Me.Width > maxNormalWidth Then
Me.Width = maxNormalWidth
End If
If Me.Height > maxNormalHeight Then
Me.Height = maxNormalHeight
End If
Me.Left = deskArea.Left + (deskArea.Right - deskArea.Left - Me.Width) /2
Me.Top = deskArea.Top + (deskArea.Bottom - deskArea.Top - Me.Height) / 2
'**************************************************
 
Ad

Advertisements

K

Kurt

Can someone help me by telling me where I can find the MSINET.OCX file that I have added to my re-work but now don't know where to get it within the VB.NET program?

I added it to the program, but now don't know how to get it to apply it to the form within VB.NET.
Any and all help is appreciated. Thank you.
 
Ad

Advertisements

K

Kurt

Can someone please help me out here, I’ve got this VB4 code I’m trying to re-do in VB.NET and find that the following VB4,6 code does not work,

Drive = App.Path & "\User_Files\profile.bda"
Open Drive For Input As #1
Input #1, dat4, Abackup, TimeHide, WhatRunmin, autorun, cleanwhen, ClockC1, Sbillboard, monthly1, monthly2, monthly3, monthly4, showmonthlies, past1, past2, past3, past4, different_day, Blink, unused3, unused4
Close #1

I’ve tried to rewrite it but not getting to far, here is what I’ve got but don’t know if it’s right either.

Drive = Application.StartupPath & "\User_Files\profile.bda"
Drive.OpenFile(Drive)
Input #1, dat4, Abackup, TimeHide, WhatRunmin, autorun, cleanwhen, ClockC1, Sbillboard, monthly1, monthly2, monthly3, monthly4, showmonthlies, past1, past2, past3, past4, different_day, Blink, unused3, unused4
Close #1
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top