New Snippet New Snippet Recent Snippets Recent Snippets My Snippets My Snippets Web Code Search Snippets Search
Sign inor Register
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)
March 03, 2010 @ 8:53am
Tags:
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,如下图所示:
March 01, 2010 @ 8:40am
Tags:
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,如下图所示:
March 01, 2010 @ 8:38am
Tags:
6 Views
no comments
 
da
February 23, 2010 @ 12:20pm
Tags:
7 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
February 23, 2010 @ 11:56am
Tags:
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>
by Utkarsh Puranik   February 23, 2010 @ 3:43am
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"))
February 15, 2010 @ 10:38am
Tags:
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)
February 11, 2010 @ 3:12pm
Tags:
12 Views
no comments
 
            UIBackgroundWorker = New BackgroundWorker()
            AddHandler UIBackgroundWorker.DoWork, AddressOf BackgroundWorker_DoWork
 
            UIBackgroundWorker.RunWorkerAsync()
by Brian Swanson   February 11, 2010 @ 8:52am
Tags:
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
by Thom Lamb   February 11, 2010 @ 6:53am
79 Views
no comments
 
dim test as string
February 09, 2010 @ 2:37pm
Tags:
16 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
by Martin Harris   February 08, 2010 @ 5:48pm
Tags: LINQ
31 Views
no comments
 
    Throw New System.NotImplementedException()
by Martin Harris   February 08, 2010 @ 4:29pm
Tags: Test
26 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")
February 08, 2010 @ 2:47pm
Tags:
23 Views
no comments
 
Return New With _
        { _
            .Status = activator.Status, _
            .Error = activator.Exception.ToString() _
        }
February 08, 2010 @ 9:17am
Tags:
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
by Steve Wright   January 21, 2010 @ 12:11pm
Tags:
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
January 18, 2010 @ 4:56am
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)
by mbbrennan   January 05, 2010 @ 9:57pm
Tags:
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
by Mitchell William Cooper   January 05, 2010 @ 7:57am
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
by aronmek   January 04, 2010 @ 12:51pm
Tags:
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
by mbbrennan   January 02, 2010 @ 3:07pm
Tags:
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
by mbbrennan   January 02, 2010 @ 3:05pm
Tags:
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)
by mbbrennan   January 02, 2010 @ 3:04pm
Tags:
40 Views
no comments
 
Imports System
Imports EnvDTE
Imports EnvDTE80
Imports System.Diagnostics
 
Public Module Environment
 
 
#Region " CollapseAll Support "
by Mark Wise   December 28, 2009 @ 2:25pm
102 Views
no comments
 
brought to you by:
West Wind Techologies


If you find this site useful and use it frequently please consider making a donation to support this free service.
Donate