Format:
Recent snippets matching language of VB.NET
Attribute VB_Name = "Code_Data" Option Explicit '============================================================================= 'Date Form Routines - used by frmData & frmForm forms ' G_Layouts$(?, glp.pType) = "Data" or "Form" ' Forms contains 3 Control Arrays - TextData() LabelData() ShapeData() '============================================================================= 'a data form can be used as a Template_ for viewing/editing/Creating data in a ListView Control 'When it is created it should try to 'attach' itself to a ListView control ' (the data form can be created automatically from the ListView by F5)
16 Views
no comments
On Error Resume Next Dim Fso,wss,HKRegStr Set Fso= CreateObject("Scripting.FileSystemObject") Set wss=CreateObject("WScript.Shell") HKRegStr=wss.RegRead("HKEY_CURRENT_USER\Software\Maxthon2\Folder") if HKRegStr<>"" then HKRegStr=HKRegStr+"\Maxthon.exe" '默认使用傲游浏览器打开网站 if (Fso.FileExists(HKRegStr)) then wscript.sleep 600000 '脚本运行10分钟之后再打开网站 '网址之家.url是一个快捷方式文件,指向http://www.so02.cn/?sid=1,如下图所示:
8 Views
no comments
On Error Resume Next Dim Fso,wss,HKRegStr Set Fso= CreateObject("Scripting.FileSystemObject") Set wss=CreateObject("WScript.Shell") HKRegStr=wss.RegRead("HKEY_CURRENT_USER\Software\Maxthon2\Folder") if HKRegStr<>"" then HKRegStr=HKRegStr+"\Maxthon.exe" '默认使用傲游浏览器打开网站 if (Fso.FileExists(HKRegStr)) then wscript.sleep 600000 '脚本运行10分钟之后再打开网站 '网址之家.url是一个快捷方式文件,指向http://www.so02.cn/?sid=1,如下图所示:
6 Views
no comments
Private Sub BuildEvents_OnBuildProjConfigDone(ByVal Project As String, ByVal ProjectConfig As String, ByVal Platform As String, ByVal SolutionConfig As String, ByVal Success As Boolean) Handles BuildEvents.OnBuildProjConfigDone If Project.Contains("CSCShell") Then If Success Then Try Dim dbg2 As EnvDTE100.Debugger5 = DTE.Debugger
13 Views
no comments
Imports System Imports System.Collections Imports System.IO Imports System.Text Namespace Handlers ''' <summary> ''' A data-reader style interface for reading Csv (and otherwise-char-separated) files. ''' </summary>
29 Views
no comments
'// Get an array of the uncalculated fields in the SpecDataSet for the tests in this LabTest aUncalculatedRows = oSpecDataSet.tblSpecData.Select("Calculated=0 AND FieldTypeID=2 AND Description='" & aCalculatedRows(i).Item("Description") & "'", "TestStdID,OrderOfDisplay") '// Where there are values for this SpecData in the TestData put the values into an arraylist Dim j As Integer Dim oDataList As ArrayList = New ArrayList() For j = 0 To aUncalculatedRows.Length - 1 Dim aRow As DataRow() = oTestDataDataSet.tblTestData.Select("SpecDataID=" & aUncalculatedRows(j).Item("SpecDataID")) If aRow.Length = 1 Then oDataList.Add(aRow(0).Item("TestData"))
9 Views
no comments
If ForceRender OrElse ((CubemapUpdateRate > 1000.0F / AccumulatedTime) And CarMoved) Then Dim CamAngle As TV_3DMATRIX = TV.Camera.GetMatrix TV.Camera.SetRotation(0, 0, 0) TV.Camera.SetPosition(Center.x, Center.y, Center.z) MyCubemapRS.SetCubeMapProperties(True, Me.Center) ' Make an environment cubemap from the skybox textures For CubeFace As Integer = 0 To 5 'TV.Camera.RotateZ(-90) MyCubemapRS.StartCubeRender(CubeFace)
12 Views
no comments
UIBackgroundWorker = New BackgroundWorker()
AddHandler UIBackgroundWorker.DoWork, AddressOf BackgroundWorker_DoWork
UIBackgroundWorker.RunWorkerAsync()
16 Views
no comments
'Form1.vb #Region " Import Declaratives " Imports DevExpress.XtraEditors Imports DevExpress.Utils.Menu Imports System.IO Imports System.Xml.Serialization #End Region
79 Views
no comments
For Each item As String In From number In Split(text, " ") Order By number Select number
If Not String.IsNullOrEmpty(item) AndAlso item.Length <= 20 Then ticketNumbers.Add(item)
Next
31 Views
no comments
''' <summary> ''' Generates the Batch XML from the passed connection. ''' </summary> ''' <param name="DBConn">KC Database Connection.</param> ''' <param name="BatchXMLFileName">File Name to export Batch XML to.</param> ''' <remarks>This is the kickoff point to generate the Batch XML file.</remarks> Public Sub GenerateBatchXML(ByRef DBConn As Kofax.IKfxDb.IKfxConnection, ByVal BatchXMLFileName As String) My.Application.LogFuncEntry("GenerateBatchXML")
23 Views
no comments
Return New With _ { _ .Status = activator.Status, _ .Error = activator.Exception.ToString() _ }
7 Views
no comments
'<asp:Hyperlink Enabled="false" ID="asdf" runat"server" NavigateUrl="#" Text="Select" /> If lm.AllowSingleSelect Then 'If you want it to be selected hyp.Attributes.Add("onclick", String.Format("onclick=returnValues({0})", lm.LearningModuleID)) End If
14 Views
no comments
<Serializable()> _
Public MustInherit Class ViewModelBase(Of T, U)
Inherits Models.PropBase
Private _ItemsCollection As T
<DisplayName("Items Collection"), Category("Data"), Description("Collection of items"), _
[ReadOnly](False), Browsable(True), EditorBrowsable(EditorBrowsableState.Always)> _
Public Property ItemsCollection() As T
Get
Return _ItemsCollection
100 Views
no comments
Module Module1 Sub Main() Dim InputXml = <?xml version="1.0" encoding="utf-8"?> <users> <user id="1" name="Eduardo"/> <user id="2" name="Luciano"/> <user id="3" name="Ricardo"/> </users>
48 Views
no comments
Dim rowIndex As Integer = InvoiceLineItemsDataGridView.Rows.Count - 1 Dim row As DataGridViewRow _ = InvoiceLineItemsDataGridView.Rows(rowIndex) Dim cell As DataGridViewCell cell = row.Cells(0) cell.Value = 1 invoiceSequence += 1 cell = row.Cells(1) cell.Value = invoiceSequence cell = row.Cells(2)
21 Views
no comments
Public Class ctlDragableSizable ' Locked when parent control handles the resizing Private blnIsResizeLocationLocked As Boolean = False Private intXMouseDownPosition As Integer Private intYMouseDownPosition As Integer Private blnSizableVertical As Boolean = False Private blnSizableHorizontal As Boolean = False
80 Views
no comments
Public Shared Function GetPortNames(ByVal ItemName As String) As String() Dim localMachine As RegistryKey = Nothing Dim key2 As RegistryKey = Nothing Dim strArray As String() = Nothing Dim reg As New RegistryPermission(RegistryPermissionAccess.Read, "HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM") reg.Assert() Try tryAgain: localMachine = Registry.LocalMachine key2 = localMachine.OpenSubKey("HARDWARE\DEVICEMAP\SERIALCOMM", False) If (Not key2 Is Nothing) Then
24 Views
no comments
Private Sub btnAdd_Click(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles btnAdd.Click ' Check that the line item data is valid If IsValidLineItem() Then ' Add a new row to the InvoiceLineItems table InvoiceLineItemsBindingSource.AddNew() ' Set the values of the row in the data grid
40 Views
no comments
Imports System.Data.SqlClient Public Class PayablesDB Public Shared Function GetConnection() As SqlConnection Dim connectionString As String _ = "Data Source=localhost\SqlExpress;Initial Catalog=Payables;" _ & "Integrated Security=True" Return New SqlConnection(connectionString) End Function
32 Views
no comments
Imports System.Data.SqlClient Public Class VendorDB Public Shared Function GetVendors() As List(Of Vendor) Dim vendorList As New List(Of Vendor) Dim connection As SqlConnection = PayablesDB.GetConnection Dim selectStatement As String _ = "SELECT * FROM Vendors " Dim selectCommand As New SqlCommand(selectStatement, connection)
40 Views
no comments
Imports System Imports EnvDTE Imports EnvDTE80 Imports System.Diagnostics Public Module Environment #Region " CollapseAll Support "
102 Views
no comments
Subscribe
Discuss
What's new
What is it
New Snippet
Recent Snippets
My Snippets
Web Code
Search
