![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
VB.NET
ijwsoft
.net, BI, java, php etc;
Sql server, Oracle, Mysql, Sqlite, Access etc;
展开
-
TreeView三层节点
控件:TreeView代码: Private Sub TreeView1_AfterSelect(ByVal sender As System.Object, ByVal e As System.Windows.Forms.TreeViewEventArgs) Handles TreeView1.AfterSelect MsgBox(TreeView1.Sele原创 2008-12-27 14:44:00 · 2532 阅读 · 3 评论 -
VB.NET中实现控件数组的功能
控件:几个文本框textbox事件:TextBoxes_textchanged代码: Private Sub TextBoxes_TextChanged(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles TextBox1.TextChanged, _ TextBox原创 2008-12-26 13:48:00 · 1753 阅读 · 0 评论 -
颜色对象
利用.NET的COLOR结构代码: Dim mycolor As Color mycolor = Color.Violet Label1.ForeColor = mycolor用户自定义颜色对象Dim mycolor As Color mycolor = Color.FromArgb(255, 0, 0)原创 2008-12-26 14:28:00 · 1108 阅读 · 0 评论 -
调试错误
利用调试窗口输出结果:1,利用Debug.Write m=64Dim i, j, k, m As Integer For i = 1 To 4 For j = 1 To 4 For k = 1 To 4 Debug.Print("The原创 2008-12-26 15:10:00 · 914 阅读 · 0 评论 -
关于listbox,选择后,如何知道它的内容?
关于listbox,选择后,如何知道它的内容?控件:listbox代码: Private Sub ListBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged For原创 2008-12-27 11:22:00 · 1328 阅读 · 0 评论 -
用VB.NET绘制GDI图形
用VB.NET绘制GDI图形 下面的例子通过重载Form1窗体的OnPaint()方法绘制GDI图形Protected Overrides Sub onpaint(ByVal e As System.Windows.Forms.PaintEventArgs)注释://///////////绘制任意直线Dim g As Graphics = e.Graphics原创 2008-12-27 11:30:00 · 3596 阅读 · 0 评论 -
知道TreeView节点的内容
控件:treeview代码: Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click For i = 1 To 20 Dim stt As New TreeNode()原创 2008-12-27 14:26:00 · 1220 阅读 · 0 评论 -
ErrorProvider控件的使用
添加一个文本框,一个ErrorProvider,,当光标离开这个文本框时判断输入的是否是一个数据代码:Private Sub TextBox1_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles TextBox1.Validating原创 2008-12-26 14:04:00 · 1681 阅读 · 0 评论 -
根据弹出式对话框的不同回答来处理
引入两个按钮,根据弹出式对话框的不同回答来处理控件:button1,button2代码:Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click MsgBox("button2") End S原创 2008-12-27 13:46:00 · 939 阅读 · 0 评论 -
直线,贝塞尔,椭圆,多边形,圆(空心的与实心的)
Dim g As Graphics = Me.CreateGraphics Dim mypen As New Pen(Color.Red) mypen.Width = 5 g.DrawLine(mypen, 1, 1, 45, 45) g.DrawBezier(mypen, 15, 15, 30, 30,原创 2008-12-26 12:14:00 · 2071 阅读 · 0 评论 -
IE浏览器
控件:WebBrowser,TreeView注意:修改WebBrowser的Anchor属性 TreeView的各个结点,以及结点的内容需要事先加入代码: Private Sub TreeView1_AfterSelect(ByVal sender As System.Object, ByVal e As System.Windows.Forms.TreeView原创 2008-12-26 13:54:00 · 1311 阅读 · 0 评论 -
SSIS script task中用代码的方式查询数据库样例
Dim sqlconstr As String = "Data Source=" + Dts.Variables("SQL01").Value.ToString() + ";Initial Catalog=EDW_PreSource;Integrated Security=True" Dim conn As SqlConnection = New SqlConnection原创 2013-04-03 11:20:33 · 1495 阅读 · 0 评论 -
通过程序 VB.Net 或 C# 读取文本文件行数
1, VB.NET 读取 (通过streamReader) ' tmpCount = 0 'Dim tmpSR As New StreamReader(fileFullName, System.Text.Encoding.Default) 'Do While tmpSR.Peek >= 0原创 2013-10-29 10:27:10 · 6332 阅读 · 2 评论 -
从某个目录中筛选文件
C# DEMO: string[] files1 = Directory.GetFiles(sSourceFolder, "*.txt", SearchOption.AllDirectories); string[] files2 = Directory.GetFiles(sSourceFolder, "*.csv", SearchOption.AllDirectorie原创 2014-01-20 16:09:42 · 1653 阅读 · 0 评论 -
直接在窗体上绘制二维文本/不加任何控件展现图像
Dim g As Graphics = Me.CreateGraphics Dim mybrush As New Drawing2D.LinearGradientBrush(ClientRectangle, Color.Blue, Color.Yellow, Drawing2D.LinearGradientMode.Horizontal) Dim原创 2008-12-26 12:39:00 · 1082 阅读 · 0 评论 -
打开/保存文本框
打开文本框控件:OpenFileDialog代码:OpenFileDialog1.InitialDirectory = Application.ExecutablePath 初始目录为应用程序的可执行路径, OpenFileDialog1.DefaultExt = ".doc" 指定默认类型 OpenFileDialog1.F原创 2008-12-25 18:23:00 · 1097 阅读 · 0 评论 -
打印/剪贴板的利用/直接打印在窗体上
打印控件: PrintDialog代码PrintDialog1.ShowDialog()利用剪贴板Clipboard.SetText(RichTextBox1.Text) 复制 Clipboard.SetText(RichTextBox1.Text) RichTextBox1.Text = Right(RichT原创 2008-12-25 18:02:00 · 1131 阅读 · 0 评论 -
把回车键转换成Tab键
把回车键转换成Tab键Private Sub TKeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown If e.KeyCode = Keys.Enter原创 2008-12-27 14:54:00 · 1858 阅读 · 0 评论 -
关于DateGridView控件
控件:DateGridView,button注意:添加DateGridView 控件后,"属性"-----"Columns"------添加8列,然后分别修改它们的"HeaderText",当然,它的ReadOnly必须为True代码: Shared i As Integer 定义一个静态变量 Private Sub Form1_Load(By原创 2008-12-28 13:31:00 · 3467 阅读 · 0 评论 -
ToolStrip工具条
ToolStrip工具条,可以添加按钮,然后修改按钮的DisplayStyle属性,可以设置工具按钮的图片形式或文字显示如果为IMAGE,要想修改其大小,可以设置ImageScaling=None,即可原创 2008-12-29 15:43:00 · 1134 阅读 · 0 评论 -
正则表达式 代码示例与教程链接
功能:提取QQ号码控件:Button代码:Public Class Form1 Private Function QQ(ByVal Adress As String) As Object Dim Cut_1() As String Dim Cut_2() As String Dim Cut_3() As St原创 2009-01-02 01:15:00 · 933 阅读 · 0 评论 -
VB.NET (VB2008)的免费下载网址
VB.NET (VB2008)的下载网址 VB.net学习版,免费下载 下载网址: http://www.microsoft.com/express/download/原创 2008-11-13 09:19:00 · 10256 阅读 · 2 评论 -
右键弹出菜单
form1的MouseDown事件If e.button=Windows.Forms.MouseButtons.Right then Cnm_menu1.show(e.X,e.Y)END IFCnm_menu1为ContextMenu原创 2009-02-18 17:56:00 · 826 阅读 · 0 评论 -
求字节长度
public function stringlen(Byval ostring) as string dim strArray() as Byte dim MyEncoder as System.Text.Encoding=System.Text.Encoding.Default strArray=MyEncoder.GetBytes(ostring) strlen=strArr原创 2009-02-18 18:02:00 · 1143 阅读 · 0 评论 -
Visual Studio 2005/2008 打包方法示例
Visual Studio 2005/2008 打包方法示例 今天终于安装了一个Visual Studio 2005 Team Suite简体中文版,新建立了个工程感觉速度比2003快很多,而且界面设置功能也强大了很多,内置XP风格菜单和工具条。打包时可以自动检测.NET Framework 2.0并将其集成到安装包,而不像2003需要安装引导程序插件PluginInstaller.ms转载 2008-12-11 20:24:00 · 4384 阅读 · 0 评论 -
用JavaScript判断文本框的合法性(经典集合)
如下: 1. 检查一段字符串是否全由数字组成 --------------------------------------- function checkNum(str){return str.match(//D/)==null} alert(checkNum( "123214原创 2009-03-11 14:54:00 · 3419 阅读 · 0 评论 -
IE浏览器
1,IE浏览器主要控件:TEXTBOX,WEBBROWSER,BUTTON代码: Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click WebBrowser1.Navigate(TextBox1.Text原创 2008-12-25 17:01:00 · 889 阅读 · 0 评论 -
动态添加treeview的节点
,动态添加treeview的节点主要控件:treeview,imagelist,button注意:treeview1.imagelist=imagelist1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Clic原创 2008-12-25 17:12:00 · 2445 阅读 · 0 评论 -
打开文件夹并显示路径
添加控件:FolderBrowserDialog,label,button代码: Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If FolderBrowserDialog1.ShowDi原创 2008-12-25 17:16:00 · 1154 阅读 · 0 评论 -
设置字体与颜色
设置字体控件:FontDialog,label注意:FontDialog1.showApply=true FontDialog1.showColor=true FontDialog1.showEffect=true代码: If FontDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then原创 2008-12-25 17:40:00 · 2069 阅读 · 8 评论 -
取文件的大小 (KB,MB,GB...)
取文件的大小 (KB,MB,GB...)2种方式: VB 和 C#1, VB Public Function GetFileSize(ByVal iFileSizeKB As Long) As String Dim iFileSizeMB As Integer Dim iFileSizeGB As Integer If (iFileSizeKB >= 1024) Th原创 2014-06-11 18:00:15 · 9761 阅读 · 0 评论