translating code from classic vb to vb.net

G

Guest

Hi EveryBody:

Can Some body help me translating the following code from classic Vb to Vb.Net

Option Explicit

Private Sub Command1_Click()

On Error GoTo command_error

With Label1
.Caption = ""
.AutoSize = True
.LinkTopic = "IExplore|WWW_GetWindowInfo"
.LinkItem = "0xffffffff"
.LinkMode = 2
.LinkRequest
End With

DoEvents

With Label2
.Caption = ""
.AutoSize = True
.LinkTopic = "Netscape|WWW_GetWindowInfo"
.LinkItem = "0xffffffff"
.LinkMode = 2
.LinkRequest
End With

Exit Sub

command_error:

'try the next step on error
Resume Next

End Sub

Any help will be appreciated

regard's

Husam
 
A

Armin Zingler

Husam said:
Hi EveryBody:

Can Some body help me translating the following code from classic Vb to
Vb.Net

Option Explicit

Private Sub Command1_Click()

On Error GoTo command_error

With Label1
.Caption = ""
.AutoSize = True
.LinkTopic = "IExplore|WWW_GetWindowInfo"
.LinkItem = "0xffffffff"
.LinkMode = 2
.LinkRequest
End With

DoEvents

With Label2
.Caption = ""
.AutoSize = True
.LinkTopic = "Netscape|WWW_GetWindowInfo"
.LinkItem = "0xffffffff"
.LinkMode = 2
.LinkRequest
End With

Exit Sub

command_error:

'try the next step on error
Resume Next

End Sub

As this is equal to "On error resume next" in this case, you can have a look
at the thread "Resuming from an error" dealing with the same problem.

http://groups.google.com/group/micr..._frm/thread/ea9ce3202200e5a6/8b141f21adaf7adf

Though, I wonder why you want to ignore all errors.

BTW, DoEvents (now Application.DoEvents) is usually not required at all, and
it was often misused in VB6.



Armin
 

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