Skip to content

Commit 880a27b

Browse files
committed
more snippets 5000 errors
1 parent aca47d7 commit 880a27b

File tree

6 files changed

+32
-28
lines changed

6 files changed

+32
-28
lines changed

snippets/visualbasic/System.Windows.Forms/HtmlDocument/Overview/Form1.vb

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
Imports System.Xml
2-
Imports System.Data
3-
Imports System.Data.SqlClient
1+
Imports System.Data
42
Imports System.Windows.Forms
3+
Imports Microsoft.Data.SqlClient
54

65
Public Class Form1
76
Public Shared Sub Main()
@@ -12,9 +11,9 @@ Public Class Form1
1211
End Sub
1312

1413
Private Sub GetDocument()
15-
' <SNIPPET17>
16-
Dim Doc as HtmlDocument = WebBrowser1.Document
17-
' </SNIPPET17>
14+
' <SNIPPET17>
15+
Dim Doc As HtmlDocument = WebBrowser1.Document
16+
' </SNIPPET17>
1817
End Sub
1918

2019
'<SNIPPET1>
@@ -36,7 +35,7 @@ Public Class Form1
3635
'<SNIPPET3>
3736
Private Function GetLastModifiedDate() As String
3837
If (Not (WebBrowser1.Document Is Nothing)) Then
39-
Dim CurrentDocument As MSHTML.IHTMLDocument2 = WebBrowser1.Document.DomDocument
38+
Dim CurrentDocument As Object = WebBrowser1.Document.DomDocument
4039
GetLastModifiedDate = CurrentDocument.lastModified
4140
Else
4241
GetLastModifiedDate = Nothing
@@ -78,9 +77,9 @@ Public Class Form1
7877
Private Sub DisplayMetaDescription()
7978
If (WebBrowser1.Document IsNot Nothing) Then
8079
Dim Elems As HtmlElementCollection
81-
Dim WebOC as WebBrowser = WebBrowser1
80+
Dim WebOC As WebBrowser = WebBrowser1
8281

83-
Elems = WebOC.Document.GetElementsByTagName("META")
82+
Elems = WebOC.Document.GetElementsByTagName("META")
8483

8584
For Each elem As HtmlElement In Elems
8685
Dim NameStr As String = elem.GetAttribute("name")
@@ -238,17 +237,17 @@ Public Class Form1
238237
End Sub
239238
'</SNIPPET14>
240239

241-
' '<SNIPPET16>
242-
' Public Sub SnipSelected()
243-
' If (webBrowser1.Document IsNot Nothing) Then
244-
' Dim o As Object = Nothing
240+
' '<SNIPPET16>
241+
' Public Sub SnipSelected()
242+
' If (webBrowser1.Document IsNot Nothing) Then
243+
' Dim o As Object = Nothing
245244
' webBrowser1.Document.ExecCommand("Copy", False, o)
246-
' Dim selected As String = CType(o, String)
247-
' If (selected IsNot Nothing) AndAlso selected.Length > 0 Then
248-
' MessageBox.Show("Selected text: " & selected)
249-
' End If
250-
'End If
251-
' End Sub
245+
' Dim selected As String = CType(o, String)
246+
' If (selected IsNot Nothing) AndAlso selected.Length > 0 Then
247+
' MessageBox.Show("Selected text: " & selected)
248+
' End If
249+
'End If
250+
' End Sub
252251
'</SNIPPET16>
253252

254253
Private Sub TestHTMLThrowButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TestHTMLThrowButton.Click

snippets/visualbasic/System.Windows.Forms/HtmlDocument/Overview/HtmlDocumentProject.vbproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,8 @@
66
<UseWindowsForms>true</UseWindowsForms>
77
</PropertyGroup>
88

9+
<ItemGroup>
10+
<PackageReference Include="Microsoft.Data.SqlClient" Version="6.1.0-preview2.25178.5" />
11+
</ItemGroup>
12+
913
</Project>

snippets/visualbasic/System.Windows.Forms/HtmlElement/Overview/Form1.vb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,16 +108,16 @@ Public Class Form1
108108
'<SNIPPET4>
109109
Private Sub CreateHyperlinkFromSelection()
110110
If (WebBrowser1.Document IsNot Nothing) Then
111-
Dim IDoc As mshtml.IHTMLDocument2 = WebBrowser1.Document.DomDocument
111+
Dim IDoc = WebBrowser1.Document.DomDocument
112112

113113
If (Not (IDoc Is Nothing)) Then
114-
Dim ISelect As mshtml.IHTMLSelectionObject = IDoc.selection
114+
Dim ISelect = IDoc.selection
115115
If (ISelect Is Nothing) Then
116116
MsgBox("Please select some text before using this command.")
117117
Exit Sub
118118
End If
119119

120-
Dim TxtRange As mshtml.IHTMLTxtRange = ISelect.createRange()
120+
Dim TxtRange = ISelect.createRange()
121121

122122
' Create the link.
123123
If (TxtRange.queryCommandEnabled("CreateLink")) Then

snippets/visualbasic/System.Windows.Forms/HtmlElement/Overview/HtmlElementProject.vbproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net9.0-windows</TargetFramework>
5+
<TargetFramework>net481-windows</TargetFramework>
66
<UseWindowsForms>true</UseWindowsForms>
77
</PropertyGroup>
88

snippets/visualbasic/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/Form1.vb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ Public Class Form1
5454
"dialogLeft: 300px; edge: Sunken; center: Yes; help: Yes; resizable: No; status: No;"
5555

5656
' Show the dialog.
57-
Dim RawWindow As mshtml.IHTMLWindow2 = Frame.DomWindow
57+
Dim RawWindow = Frame.DomWindow
5858
RawWindow.showModalDialog("http://www.adatum.com/dialogWindow.htm", Nothing, CObj(DialogArguments))
5959
End If
6060
End Sub
@@ -261,7 +261,7 @@ Public Class Form1
261261

262262

263263
'<SNIPPET14>
264-
Dim WithEvents Doc As Windows.Forms.HtmlDocument
264+
Dim WithEvents Doc As HtmlDocument
265265

266266
Private Sub EnableClickScroll()
267267
If (WebBrowser1.Document IsNot Nothing) Then

snippets/visualbasic/System.Windows.Forms/MouseEventArgs/Overview/Form1.vb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
1-
Imports System.Windows.Forms
1+
Imports System.Drawing
2+
Imports System.Windows.Forms
23

34
Public Class Form1
45
Public Shared Sub Main()
56
End Sub
67

78
'<SNIPPET1>
89
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
9-
TextBox1.ContextMenu = New ContextMenu()
10+
TextBox1.ContextMenuStrip = New ContextMenuStrip()
1011
End Sub
1112

1213
Private Sub TextBox1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles TextBox1.MouseDown
13-
If (e.Button = Windows.Forms.MouseButtons.Right) Then
14+
If (e.Button = MouseButtons.Right) Then
1415
TextBox1.Select(0, TextBox1.Text.Length)
1516
End If
1617
End Sub

0 commit comments

Comments
 (0)