PC Review Forums Newsgroups Microsoft DotNet Microsoft VB .NET translating code from classic vb to vb.net

Reply

translating code from classic vb to vb.net

 
Thread Tools Rate Thread
Old 21-09-2007, 10:54 AM   #1
=?Utf-8?B?SHVzYW0=?=
Guest
 
Posts: n/a
Default translating code from classic vb to vb.net


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
  Reply With Quote
Old 21-09-2007, 11:32 AM   #2
Armin Zingler
Guest
 
Posts: n/a
Default Re: translating code from classic vb to vb.net

"Husam" <Husam@discussions.microsoft.com> schrieb
> 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...b141f21adaf7adf

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

  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off