精华内容
下载资源
问答
  • 内容索引:VB源码,界面编程,窗体菜单,单选按钮,复选按钮 VB6 在窗体菜单加入Radio单选按钮和Check复选按钮,平时我们已经见到过了,虽然比较小的应用,不过挺实用,用了会增加软件体验,为用户操作提供方便,...
  • 小眼Check复选框控件VB源码,一个漂亮的Check控件,能响应鼠标经过和离开事件,把鼠标点选的操作方式变为当下流行的左右拨动式,类似很多智能手机上的开关功能,Val=1代表False,Val=2代表True,只提供了一个Click...
  • VB6 在窗体菜单加入Radio单选按钮和Check复选按钮,平时我们已经见到过了,虽然比较小的应用,不过挺实用,用了会增加软件体验,为用户操作提供方便,Windows系统里就有,好像见惯不惯了。
  • [color=red]判断Check复选框是否被选中[/color] Check1.Value为1是选中,为0是没选中 [code="c"]If Check1.Value = 1 Then MsgBox "选中" End If[/code] [color=red]删除数组的一个...
    [color=red]判断Check复选框是否被选中[/color]
    

    Check1.Value为1是选中,为0是没选中

    If Check1.Value = 1 Then
    MsgBox "选中"
    End If


    [color=red]删除数组中的一个值[/color]

    比如数组xh中有10个值,现删除第5个值

    Dim tmp As Integer
    For tmp = 4 To 9
    xh(tmp) = xh(tmp + 1)
    Next


    [color=red]获得数组大小[/color]

    UBound(xh)

    [color=red]创建动态数组[/color]

    ReDim Preserve xh(UBound(xh) + 10) '变大后原有值不变,变小后则后边值会变没

    [color=red]创建一个返回数组型的函数[/color]

    返回数组型函数定义

    Public Function Load_XH(comText As String, xh() As String)
    xh(0) = 0
    xh(1) = 1
    xh(2) = 2
    End Function


    调用

    Dim xh(10) As String
    Call Load_XH(Combo1.Text, xh) '返回一个数组函数


    使用

    msgBox xh(1)

    [color=red]删除本地图片[/color]

    Kill ("D:\temp.jpg")

    黑色头发:http://heisetoufa.iteye.com/
    展开全文
  • VB设置字体样式:字体加粗、字体下划线、删除线、斜体等样式的设置例子,对于美化和制作个性化的窗口文字,可起到很好的借鉴使用。实现时分别定义几个按钮,为按钮添加以下事件:  Private Sub Check1_Click()  ...
  • VB.net check whether a file is opened or not

    千次阅读 2013-09-10 12:36:19
    Private Sub Test(ByRef sName As String)  Dim fs As FileStream  Try  fs = File.Open(sName, FileMode.Open, FileAccess.Read, FileShare.None)  excel_file_opened = F

    Dim excel_file_opened As Boolean = False

    Private Sub Test(ByRef sName As String)

            Dim fs As FileStream
            Try
                fs = File.Open(sName, FileMode.Open, FileAccess.Read, FileShare.None)
                excel_file_opened = False
                fs.Close()
            Catch ex As Exception
                excel_file_opened = True
            End Try
        End Sub
    展开全文
  • 5VB基础控件篇.Option单选与Check复选控件[汇编].pdf
  • 5VB基础控件篇.Option单选与Check复选控件[定义].pdf
  • Datagridview控件没有全选或取消全选的复选框,本资源用VB2015通过扩展DataGridViewColumnHeaderCell类,在列头绘制一个复选框checkbox控件,通过定义checkbox鼠标单击事件来实现行的全选或取消全选。checkbox还可以...
  • VB.NET的命名空间

    2020-09-14 04:24:46
    vb.net 命名空间 The most common way VB.NET namespaces are used by most programmers is to tell the compiler which .NET Framework libraries are needed for a particular program. When you choose a ...

    The most common way VB.NET namespaces are used by most programmers is to tell the compiler which .NET Framework libraries are needed for a particular program. When you choose a "template" for your project (such as "Windows Forms Application") one of the things that you're choosing is the specific set of namespaces that will be automatically referenced in your project. This makes the code in those namespaces available to your program.

    大多数程序员使用VB.NET命名空间最常见的方式是告诉编译器特定程序需要哪些.NET Framework库。 当为项目(例如“ Windows Forms Application”)选择“模板”时,要选择的一件事就是将在项目中自动引用的特定名称空间集。 这使那些名称空间中的代码可用于您的程序。

    For example, some of the namespaces and the actual files they are in for a Windows Forms Application are:

    例如,Windows窗体应用程序中的某些名称空间和实际文件为:

    System > in System.dllSystem.Data > in System.Data.dllSystem.Deployment > System.Deployment.dllSystem.Drawing > System.Drawing.dllSystem.Windows.Forms > System.Windows.Forms.dll

    系统>在System.dllSystem.Data中>在System.Data.dllSystem.Deployment中> System.Deployment.dllSystem.Drawing> System.Drawing.dllSystem.Windows.Forms> System.Windows.Forms.dll

    You can see (and change) the namespaces and references for your project in the project properties under the References tab.

    您可以在“ 引用”选项卡下的项目属性中查看(并更改)项目的名称空间和引用。

    This way of thinking about namespaces makes them seem to be just the same thing as "code library" but that's only part of the idea. The real benefit of namespaces is organization.

    这种关于名称空间的思考方式使它们看起来与“代码库”一样,但这只是其中的一部分。 名称空间的真正好处是组织。

    Most of us won't get the chance to establish a new namespace hierarchy because it's generally only done once 'in the beginning' for a large and complicated code library. But, here, you'll learn how to interpret the namespaces that you will be asked to use in many organizations.

    我们大多数人没有机会建立新的名称空间层次结构,因为对于大型而复杂的代码库,它通常仅在“开始”时完成一次。 但是,在这里,您将学习如何解释将要求您在许多组织中使用的名称空间。

    命名空间做什么 ( What Namespaces Do )

    Namespaces make it possible to organize the tens of thousands of .NET Framework objects and all the objects that VB programmers create in projects, too, so they don't clash.

    命名空间使组织成千上万的.NET Framework对象以及VB程序员在项目中创建的所有对象成为可能,因此它们不会冲突。

    For example, if you search .NET for a Color object, you find two. There is a Color object in both:

    例如,如果在.NET中搜索Color对象,则会找到两个。 两者中都有一个Color对象:

    
    System.Drawing
    Sys

    If you add an Imports statement for both namespaces (a reference may also be necessary for the project properties) ...

    如果为两个名称空间都添加Imports语句(项目属性也可能需要引用)...

    
    Imports System.Drawing
    Imports Sys

    ... then a statement like ...

    ...然后像...这样的声明

    ... will be flagged as an error with the note, "Color is ambiguous" and .NET will point out that both namespaces contain an object with that name. This kind of error is called a "name collision."

    ...将被标记为带有错误的错误标记,“颜色不明确”,.NET将指出两个名称空间都包含具有该名称的对象。 这种错误称为“名称冲突”。

    This is the real reason for "namespaces" and it's also the way namespaces are used in other technologies (such as XML). Namespaces make it possible to use the same object name, such as Color, when the name fits and still keep things organized. You could define a Color object in your own code and keep it distinct from the ones in .NET (or the code of other programmers).

    这是“命名空间”的真正原因,也是其他技术(例如XML)中使用命名空间的方式。 使用名称空间,可以在名称合适的情况下使用相同的对象名称,例如Color ,并且仍然使事物保持井井有条。 您可以在自己的代码中定义Color对象,并使其与.NET(或其他程序员的代码)中的对象不同。

    
    Namespace MyColor
    Public Class Color
    Sub Color()
    ' Do something
    End Sub
    End Class

    You can also use the Color object somewhere else in your program like this:

    Before getting into some of the other features, be aware that every project is contained in a namespace. VB.NET uses the name of your project (WindowsApplication1 for a standard forms application if you don't change it) as the default namespace. To see this, create a new project (we used the name NSProj and check out the Object Browser tool):

    1. Click Here to display the illustration

    2. Click the Back button on your browser to return

    The Object Browser shows your new project namespace (and the automatically defined objects in it) right along with the .NET Framework namespaces. This ability of VB.NET to make your objects equal to .NET objects is one of the keys to the power and flexibility. For example, this is why Intellisense will show your own objects as soon as you define them.

    To kick it up a notch, let's define a new project (We named ours NewNSProj in the same solution (use File > Add > New Project ...) and code a new namespace in that project. And just to make it more fun, let's put the new namespace in a new module (we named it NewNSMod). And since an object must be coded as a class, we also added a class block (named NewNSObj). Here's the code and Solution Explorer to show how it fits together:

    1. Click Here to display the illustration

    2. Click the Back button on your browser to return

    Since your own code is 'just like Framework code', it's necessary to add a reference to NewNSMod in NSProj to use the object in the namespace, even though they're in the same solution. Once that's done, you can declare an object in NSProj based on the method in NewNSMod. You also need to "build" the project so an actual object exists to reference.

    Dim o As New NewNSProj.AVBNS.NewNSMod.NewNSObj

    That's quite a Dim statement though. We can shorten that by using an Imports statement with an alias.

    
    Namespace MyColor
    Public Class Color
    Sub Color()
    ' Do something
    End Sub
    End Class

    You can also use the Color object somewhere else in your program like this:

    Before getting into some of the other features, be aware that every project is contained in a namespace. VB.NET uses the name of your project ( WindowsApplication1 for a standard forms application if you don't change it) as the default namespace. To see this, create a new project (we used the name NSProj and check out the Object Browser tool):

    1. Click Here to display the illustration

    2. Click the Back button on your browser to return

    The Object Browser shows your new project namespace (and the automatically defined objects in it) right along with the .NET Framework namespaces. This ability of VB.NET to make your objects equal to .NET objects is one of the keys to the power and flexibility. For example, this is why Intellisense will show your own objects as soon as you define them.

    To kick it up a notch, let's define a new project (We named ours NewNSProj in the same solution (use File > Add > New Project ... ) and code a new namespace in that project. And just to make it more fun, let's put the new namespace in a new module (we named it NewNSMod ). And since an object must be coded as a class, we also added a class block (named NewNSObj ). Here's the code and Solution Explorer to show how it fits together:

    1. Click Here to display the illustration

    2. Click the Back button on your browser to return

    Since your own code is 'just like Framework code', it's necessary to add a reference to NewNSMod in NSProj to use the object in the namespace, even though they're in the same solution. Once that's done, you can declare an object in NSProj based on the method in NewNSMod . You also need to "build" the project so an actual object exists to reference.

    Dim o As New NewNSProj.AVBNS.NewNSMod.NewNSObj

    That's quite a Dim statement though. We can shorten that by using an Imports statement with an alias.

    • A requirement for namespace organization in the first place. You need more than just a "Hello World" project before the organization of namespaces starts to pay off.

      首先是名称空间组织的要求。 在命名空间的组织开始获得回报之前,您不仅仅需要一个“ Hello World”项目。
    • A plan to use them.

      使用它们的计划。

    In general, Microsoft recommends that you organize your organization's code using a combination of your company name with the product name.

    通常, Microsoft建议您使用公司名称和产品名称的组合来组织组织的代码。

    So, for example, if you're the Chief Software Architect for Dr. No's Nose Knows Plastic Surgery, then you might want to organize your namespaces like ...

    因此,例如,如果您是No's Nose Knows Surgery的首席软件架构师,那么您可能想要组织名称空间,例如...

    
    DRNo
    Consulting
    ReadTheirWatchNChargeEm
    TellEmNuthin
    Surgery
    ElephantMan

    This is similar to .NET's organization ...

    
    DRNo
    Consulting
    ReadTheirWatchNChargeEm
    TellEmNuthin
    Surgery
    ElephantMan

    This is similar to .NET's organization ...

    翻译自: https://www.thoughtco.com/namespaces-in-vbnet-3424445

    展开全文
  • vb '給与〆支払条件 abc = Nothing abc = New ListViewItem.ListViewSubItem() Dim siharai_str As String = check_dbnull(rs.Fields("sime_str").Value) & "" & check_dbnull(rs.Fields(...

    vb

     				'給与〆支払条件
                    abc = Nothing
                    abc = New ListViewItem.ListViewSubItem()
                    Dim siharai_str As String = check_dbnull(rs.Fields("sime_str").Value) & "" & 			 		  check_dbnull(rs.Fields("siharai_str").Value)
                    abc.Text = siharai_str
                    Dim sime_siharai_str As String = set_sime_siharai_str(rs.Fields("ko_cd").Value)
                    If sime_siharai_str <> siharai_str Then
                        abc.BackColor = Color.LightPink
                        abc.ForeColor = Color.White
                    End If
                    lvi.SubItems.Add(abc)
    
    展开全文
  • VB字体设置

    2013-06-10 14:38:45
    您想知道字体设置的代码吗?Private Sub Check1_Click() Text1.FontBold = Not Text1.FontBold End Sub Private Sub Check2_Click() Text1.FontItalic = Not Text1.FontItalic End Sub ......
  • 摘要:VB源码,文件操作,文件夹监控 VB监控指定文件夹里的文件操作,比如新建、删除、重命名等。当程序发现文件夹内的内容改变时候会弹出提示框,对大家编写文件夹加密、文件夹监控软件应该有点帮助吧。很早前从网上...
  • 以下是VB.NET语句。 Dim checkedb As RadioButton checkedb = GroupBox1.Controls.OfType(Of RadioButton )().FirstOrDefault( Function (r) r.Checked = True ) Debug . Print (checkedb.Name) ...
  • VB MSFlexGrid网格控件绑定Combox,Check,ListBox等窗体常用元素的实例,利用MSFlexGrid做的单元格输入示例,演示如何在MSFlexGrid单元格绑定下拉列表、复先框、单选框(Combox,Check,ListBox)等,以方便用户输入和...
  •  本例子主要包括了对VB基本控件元素Check、Option、Text、Label、Button的用法进行了演示,具分享出了具体实现某一功能的代码及设置方法,涉及到光标自动归位、清空文本框、判断用户输入是否正确,断用户选择了哪...
  • VB.NET实现拖放操作

    千次阅读 2016-05-10 15:44:35
    VB.NET实现拖放操作  绪论  Windows用户一般分为两类:一类习惯用键盘操作,一类习惯用鼠标操作。程序员们在编程时一般会提供快捷键(在命令或字母中加下划线)或快捷方式(用CTRL加字母的组合)来...
  • 如何在VB中通过相对路径引用标准DLL

    千次阅读 2019-06-25 22:57:28
    很长时间以来,都认为只能通过绝对路径引用标准DLL的函数。其实,你也可以用相对路径。很简单的,现在就尝试一下吧。 1)绝对路径方法 比如你的DLL文件位于c:\testDLL\debug\testDLL.dll 一般来说,...
  • VB 鼠标双击触发的DblClick事件
  • vb.net 数据类型转换 Casting is the process of converting one data type to another, for example, from an Integer type to a String type. Some operations in VB.NET require specific data types to work. ...
  •   vb6存在几个虚幻的值:Null、Missing、Empty、Nothing、vbNullString。除了最后一个之外,每一个值都不能直接用“a=值”来判断。下面分别解释一下这几个值的含义。 1、Null Null指一个不合法的数据,判断一...
  • VB.NET 教程_01_基础语法

    万次阅读 多人点赞 2018-08-08 00:48:58
    VB.Net是一种简单,现代,面向对象的计算机编程语言,由微软开发,将.NET Framework和公共语言运行库的强大功能与作为Visual Basic标志的生产力优势相结合。 Visual Basic .NET(VB.NET)是在.NET Framework上...
  • VB常用技巧合集

    2014-08-19 16:57:57
    VB常用技巧合集 chm全集,比如ActiveX .Exe ....DAO 得到存储过程返回值,VB程序处理随机事件,VB应用程序访问SQL Server方法探讨,VB应用程序中用DDE功能开发AutoCAD,按字母或数字顺序排列列表框的列表项……
  • C#基础教程-c#实例教程,适合初学者

    万次阅读 多人点赞 2016-08-22 11:13:24
    在.NET这些组件或动态联接库不必在注册表注册,每个程序都可以使用自带的组件或动态联接库,只要把这些组件或动态联接库放到运行程序所在文件夹的子文件夹bin,运行程序就自动使用在bin文件夹的组件或动态...
  • 设计程序。利用3个复选框Check1、Check2、Check3代表红、绿、蓝三颜色值,当选中复选框时表示颜色值为255,不选中为0,把通过RGB函数调配的颜色作为一个标签Label1的背景色。
  • nan和infinity Beginning programming books usually include this warning: "Don't divide by zero! You'll get a runtime error!" 入门的编程书籍通常包含以下警告:...Things have changed in VB.NET. Althoug...
  • vb.net DataGridViewCheckBox 状态

    千次阅读 2015-09-09 17:20:02
    DataGridViewCheckBox单元格点击时,出现的问题。 点击该单元格,非CheckBox部分,虽然...   Dim cell AS DataGridViewCheckBoxCell = dgvList.Rows(e.RowIndex).Cells("列名") cell.ReadOnly = true ...Dim checked
  • VB 单选按钮、复选按钮和框架控件

    千次阅读 2020-12-11 12:32:37
    单选按钮Option和复选按钮Check都是用于实现选择操作的控件,前者可实现单选,后者可实现多选。框架Frame控件可以用来对窗体上的控件进行分组。在同一框架下的单选按钮有且只能被选中一项,而复选按钮则可以选择多项...

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 12,927
精华内容 5,170
关键字:

vb中check