随笔分类 -  VB

1 2 下一页
怎样用VB编写.DLL动态链接库文件
摘要:VB一般可以生成两种特殊的DLL,一个是ActiveX DLL和ActiveX Control(*.ocx)。这两种DLL都是VB支持的标准类型,在VB自身的例子中有,你可以参考。更详细的介绍可以参考我写的《Visual Basic编程晋级:ActiveX控件》(http://china.zealsoft.com/articles/vbactivex/)一书的“第十六章 其他ActiveX部件 ”。 VB中创建的DLL只是COM组件,无法作为输出函数的DLL,其实这只是个错误的说法。其实MS非常狡猾,如果你是个VB疯狂发烧友的话,应该早就狂试出这种可以创建输出函数的DLL的方法。 ... 阅读全文
posted @ 2014-04-10 15:17 vinsonLu 阅读(7923) 评论(0) 推荐(2)
vb 随机获取6个1-33的数
摘要:```vbnet Private Sub random(ByVal num As Integer, ByVal min As Integer, ByVal max As Integer) Dim i As Integer = 1 Dim number As Integer Dim numbers As String = "" While i 0 number = CInt(Rnd() * (max - min + 1) + 1) End While numb... 阅读全文
posted @ 2014-02-20 11:43 vinsonLu 阅读(530) 评论(0) 推荐(0)
vb 取得桌面路径
摘要:```vbnettxtPath.Text = System.Environment.GetFolderPath(Environment.SpecialFolder.Desktop)``` 阅读全文
posted @ 2014-02-20 11:24 vinsonLu 阅读(1946) 评论(0) 推荐(0)
VB 读取csv文件数据
摘要:Public adoConn As New ADODB.Connection Private Sub csv() adoConn.ConnectionString = "Driver={Microsoft Text Driver (*.txt; *.csv)};DefaultDir=C:\Documents and Settings\vinsonlu\Desktop\1400004" adoConn.Open() Dim rs As New ADODB.Recordset rs.Open("select * from Orders... 阅读全文
posted @ 2014-02-14 14:53 vinsonLu 阅读(9309) 评论(0) 推荐(0)
VB datagrid指定行着色
摘要:有图有真相:关键点:使用datagrid的FetchRowStyle委托。(Form界面的datagrid名称:dgv)使用FetchRowStyle委托,要先打开开关:dgv.FetchRowStyles = True然后可以在FetchRowStyle委托里面更改datagrid每一行的单元格格式:Private Sub dgv_FetchRowStyle(ByVal sender As Object, ByVal e As C1.Win.C1TrueDBGrid.FetchRowStyleEventArgs) Handles dgv.FetchRowStyle If dgv... 阅读全文
posted @ 2014-02-13 12:17 vinsonLu 阅读(4343) 评论(0) 推荐(0)
Crystal Report 处理当前系统时间
摘要:Changed the print date format to HH/yy/MM/mm/SS/dd (For Example:2014/01/23 16:30:45= 161430014523) :iif(Hour(CurrentTime)<10,left('0'+totext(Hour(CurrentTime)),2),left(totext(Hour(CurrentTime)),2))+right(left(totext((Year(CurrentDate))),5),2)+iif(Minute(CurrentTime)<10,left('0' 阅读全文
posted @ 2014-02-11 15:45 vinsonLu 阅读(858) 评论(0) 推荐(0)
数据库连接字符串大全
摘要:出处:http://www.how2y.com/mini/Default.asp?61-1161-0-0-0-0-0-a-.htmMySQL 连接方式-----------MySQL Connector/ODBC 2.50 (MyODBC 2.50)连接方式本地数据库连接Driver={mySQL};Server=localhost;Option=16834;Database=myDataBase;远程数据连接:Driver={mySQL};Server=myServerAddress;Option=131072;Stmt=;Database=myDataBase; User=myUserna 阅读全文
posted @ 2014-01-06 17:43 vinsonLu 阅读(2425) 评论(0) 推荐(0)
用dataset保存数据注意的问题
摘要:Private Function Save() As Boolean Try Dim dschgs As DataSet = ds.GetChanges(DataRowState.Added + DataRowState.Deleted + DataRowStat... 阅读全文
posted @ 2014-01-06 11:46 vinsonLu 阅读(1764) 评论(0) 推荐(0)
vb和c#插入行与删除行
摘要:vb:xSheet.Range("A3").Resize(1, 3).Insert(Shift:=Excel.XlDirection.xlDown)xSheet.Range("A3").Resize(1, 3).Delete()xSheet.Range("A2").Resize(ds.Tables(i).Rows.Count + 1, 3).Value = datac#:((Excel.Range)xSheet.Cells[4, 4]).EntireRow.Insert(null, null); //添加行((Excel.Range) 阅读全文
posted @ 2013-12-17 10:11 vinsonLu 阅读(302) 评论(0) 推荐(0)
vb 导出excel生成图表统计
摘要:Private Sub btnExprot_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExprot.Click If Not T Is Nothing Then If T.ThreadState = ThreadState.Running Then Exit Sub End If T = New Thread(AddressOf Export) T.Start() End Sub Private... 阅读全文
posted @ 2013-12-13 16:26 vinsonLu 阅读(3706) 评论(0) 推荐(0)
vb 读取指定路径文件名
摘要:Private Sub ExportCostSheetData() InsertRow("") InsertRow("Run 2:Export CostingSheet=========================") InsertRow("Status:System Connectting DataBase!") If ConnJWeb() = False Or ConnJWeb2() = False Then InsertRow("Status:System Connectting DataBase fial... 阅读全文
posted @ 2013-12-09 11:01 vinsonLu 阅读(4695) 评论(0) 推荐(0)
vb shell函数在c#的转换
摘要:vb shell:Private Sub AddBarcodeImages(ByVal DTab As DataTable) If Not DTab Is Nothing Then DTab.Columns.Add("BCIMAGE", Type.GetType("System.Byte[]")) Dim r As DataRow For Each r In DTab.Rows Try Dim BatchNo As String = CStr(r.... 阅读全文
posted @ 2013-11-06 17:16 vinsonLu 阅读(714) 评论(0) 推荐(0)
Bogart BogartAutoCode.vb
摘要:Imports System.Data.SqlClientImports System.DataPublic Class BogartAutoCodeDataBase Private Conn As SqlClient.SqlConnection = SqlConnect Sub New() 'Conn = New BogartAutoCodeConnection End Sub ' 保存的错误! Private _StrError As String = "" Friend ReadOnly Property StrError() As St... 阅读全文
posted @ 2013-10-14 14:51 vinsonLu 阅读(262) 评论(0) 推荐(0)
Bogart BogartPublic.vb
摘要:Imports System.Data.SqlClientImports System.Data#Region "IBogartToolbar,請勿隨便更改"Interface IBogartToolbar Sub j_menuPrint() Sub j_LoadData() 'Sub j_setToolsBar() Sub j_ChangeRecord() Sub j_AddRow() Sub j_EditRow() Property EnabledPrint() As Boolean Sub SetToolsControl(ByVal g ... 阅读全文
posted @ 2013-10-14 14:50 vinsonLu 阅读(208) 评论(0) 推荐(0)
Bogart SysPwd.vb
摘要:Module syspwd Public Const STR_MASK = "MyFunction" '加密用字串 Public Const INT_PWD_LENGTH = 10 '預定義密碼長度 Public GintCheckPwd As Integer '當傳入的密碼長度大於預定義密碼長度時 '將?生一個Message Box '以下兩個常量是該Message Box中的具體提示資訊和標題欄中的文字 Public Const STR_PWD_ERROR = "The length of pas... 阅读全文
posted @ 2013-10-14 14:47 vinsonLu 阅读(227) 评论(0) 推荐(0)
Bogart gFunction.vb
摘要:Module gFunction '其它不是常用的方法及函數#Region " 將指定的數據格式轉換為英文格式" Public Function EnglishFormat(ByVal intNum As Double, ByVal blnMoney As Boolean) As String On Error GoTo err Dim strNum As String Dim intStart As Integer Dim strInt As String '整數位 Dim strDec As St... 阅读全文
posted @ 2013-10-14 14:39 vinsonLu 阅读(283) 评论(0) 推荐(0)
Bogart gGrid.vb
摘要:Namespace BogartMis.Cls Public Class gGrid '設定表格控的列標題的別名 '說明:strItem字符串的格式為"01,02,03,04,05" 其中[01]這個字符串中不得包含特定符號 '特定符號: # / . - * 等 Public Overloads Sub setGridColCaption(ByVal g As DataTable, ByVal strItem As String) Try Dim myArray As String... 阅读全文
posted @ 2013-10-14 14:37 vinsonLu 阅读(434) 评论(0) 推荐(0)
Bogart gData.vb
摘要:Imports SystemImports System.DataImports System.Data.OleDbImports Microsoft.VisualBasicImports System.ConsoleImports System.Windows.FormsImports System.IOImports System.TextImports System.DrawingNamespace BogartMis.Cls Public Class DataControl #Region "SQL Process " Public Function... 阅读全文
posted @ 2013-10-14 14:32 vinsonLu 阅读(371) 评论(0) 推荐(0)
vb 使用StreamWriter书写流写出数据并生成文件
摘要:sql = "Select case when date ='' then '0'else CONVERT(varchar(100), date, 101) end as date,case when ad ='' then '0'else CONVERT(varchar(100), ad, 101) end as ad,event1,type1,code from EventData where ip='" + UserIP + "' order by code,event1&quo 阅读全文
posted @ 2013-10-14 14:29 vinsonLu 阅读(4591) 评论(0) 推荐(0)
vb 水晶报表打印
摘要:vb里面的水晶报表打印控件:CrystalReportViewer用到的dll文件:水晶报表打印其实很简单,只要创建报表对象,再对其传递数据就可以打印出来。当然所传递的数据要与水晶报表设计里面的数据一致:Public Overloads Sub ShowDialog(ByVal netDs As DataSet, ByVal strPath As String, Optional ByVal showPrint As Boolean = True, Optional ByVal showExport As Boolean = True) Try If net... 阅读全文
posted @ 2013-09-12 12:54 vinsonLu 阅读(5680) 评论(1) 推荐(0)

1 2 下一页