社区
VB基础类
帖子详情
DBGrid有没有Rows属性(VB6)?如何运行中给DBGrid增加一行?
lbg
2001-03-11 10:51:00
...全文
191
2
打赏
收藏
DBGrid有没有Rows属性(VB6)?如何运行中给DBGrid增加一行?
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
2 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
liuzhiyong97751
2001-03-12
打赏
举报
回复
你可以先使用add方法,然后再用update方法
xycleo
2001-03-11
打赏
举报
回复
也使用ADD吧
VB常用附加控件【特别整理了表格控件】
表格控件总览: 在VB开发环境
中
,表格控件在界面开发元素
中
占有重要的地位。它不仅有外观整洁、表达形式规范的优点,而且更重要的是它较高的信息表现率(就是相对于其他控件来说能够表达更多的信息),随着信息时代的到来,它的应用将更加的广泛。 那么在VB平台下,如何操作这一功能强大的控件元素呢?事实上我们知道,VB平台下面的表格控件是相当丰富的,总结下来提供了4种类型:Microsoft Data Bound
grid
Control、Microsoft Data
grid
Control、Microsoft Flex
grid
Control、Microsoft Hierarchial Flex
grid
Control. 这四种表格各有其特点,下面我们一一讨论。 1. Microsoft Data Bound
grid
Control 此控件主要用于数据绑定(可以不绑定,但是因为不提供对单个cell的控制支持,所以实际上这样做是不经济的)。具体说来,就是数据源比较固定的情况下可以使用这种控件。 具体使用方法是设定此控件的datasource
属性
,就可以不用编写任何代码就可以显示该数据源所指向的记录数据。比如可以将datasource设置为一个data控件,而data控件又指向数据库"成绩"的 一个"语文"表,那么当程序
运行
时,它就自动显示此"语文"表的数据。 基本步骤如下: 1、向工程上添加Microsoft Data Bound
Grid
Control控件,即
DB
Grid
控件。 2、在窗体上添加
DB
Grid
控件
DB
Grid
1和Data控件Data1。 3、设置Data1的DatabaseName
属性
为你要看的数据库的名字。 4、设置Data1的RecordSource
属性
为表的名字或合法的SQL Select语句。 5、设置
DB
Grid
1的DataSource
属性
为Data1。 从上面的分析看得出来,这个控件虽然操作方便,但是它也有局限性,就是不能对显示的数据进行灵活的控制操作,比如有些数据允许用户修改,有些数据却不允许用户修改,而此控件却只能提供全部数据源的原子操作:即要么全部允许修改,要么就全部不允许。还有另外此控件也不提供对单个单元格(cell)进行操作,所以提供不了更为个性化的界面风格。 2. Microsoft Data
grid
Control 此控件跟前面介绍的Data Bound
grid
Control控件很相似,也是主要进行绑定操作,而缺点和Data Bound
grid
Control完全一样。但是它跟Data Bound
grid
Control不一样的是其数据源的驱动引擎只能是OLE
DB
形式的,不能是DAO,比如就可以使用ADO数据控件,不能使用DATA控件。而Data Bound
grid
Control却刚好和它相反,这一点在开发
中
一定要注意。 3. Microsoft Flex
grid
Control与Microsoft Hierarchial Flex
grid
Control. 这里重点介绍这两种控件,因为在实际开发
中
,这两种控件应用的场合更多一些,它不仅能够反映数据,而且也能把数据的修改信息反映到数据库
中
去,所以弥补了上述两种控件的不足。 如果数据不需要修改,那么可以进行绑定操作,其方法跟前面介绍的完全一样,就是通过设置DataSource
属性
来完成数据的显示工作。但是实际开发
中
,需要对整个表格控件更为灵活的显示控制。 在给出例程之前,有必要对这一控件进行比较详尽的认识:这种控件允许将文本或者图象放置于每个单元格之
中
,控件的Row与Col
属性
允许用户在代码
中
指定当前行和列,当然也可通过操作鼠标和键盘来改变这两个
属性
,而text
属性
指明当前单元格的文本。如果单元格的文本太长而不能完全显示出来的话,可以通过将WordWrap
属性
设置为true来达到显示的目的。下面将比较重要的
属性
小结如下: DataSource---------用来指定需要绑定的数据源,比如data控件。 Cellpicture----------用来设定当前单元格的图象,便于显示该图象。此
属性
不能在设计时使用。 Col,Row---------------设定当前列和当前行,注意它们均是从0开始的,如果同时设定它们,可以指定当前的单元格。设计时也不能使用。 Cols,
Rows
---------------设置表格控件总的列数和行数。 Hwnd---------------表格句柄,可以结合Windows API对表格控件进行更高级的控制。 Text---------------指定当前的单元格的文本内容。 TextMatrix(i,j)-------此
属性
比较重要,它用来指定第I行和第j列所确定的单元格的文本内容。它等价于下面的代码: MSHFlex
Grid
1.
Rows
=i MSHFlex
Grid
1.Cols =j MSHFlex
Grid
1.Text =指定的字符串 WordWrap-------为ture时可以在当前单元格换行显示,否则如果要显示的字符的长度超过列宽,那么就不能显示完全。
Studio for WinForms 2012 v2 1/3
Studio for WinForms 2012 v2 1/3 C1StudioNet_2012v2.msi 共三个压缩分卷,请全部下载后解压 65+ .NET Windows Forms controls, including the ones you can't get anywhere else. Generate a
grid
with a million
rows
to a chart with unlimited points. Smart and Powerful WinForms Controls for Rapid UI Development Over 65 .NET Windows Forms controls, including the ones you can't get anywhere else. ComponentOne Studio® for WinForms controls come packed with smart, code-free designers, endless built-in features, superior flexibility, and the outstanding assurance that these controls will stand the test of time. What's Inside? § Chart § Flex
Grid
§ GanttView § Reports § Ribbon § True
DB
Grid
Why Choose Studio for WinForms? § Best Selling
Grid
s in the Market Since 1991 ComponentOne has been offering two award-winning
grid
s for creating Windows Client applications: Flex
Grid
and True
DB
Grid
. Each is designed to give you the best performance and features for different types of applications. Both
grid
s offer many out-of-the-box features like filtering, hierarchical data-binding, grouping, printing, and exporting to Microsoft Excel without any additional coding required. See a comparison. § All-in-one Reporting Solution With a rich object model for generating reports, several UI controls for previewing, and a report designer for creating and designing reports, Reports for WinForms is your all-in-one reporting solution. Generating cutting-edge reports for your .NET applications has never been easier. You can even integrate your existing reporting solutions (SQL Server, Access, Crystal) into your applications. § Mimic Popular Microsoft UIs and Layouts Replicate popular interfaces as seen in Microsoft Office and other programs using Studio for WinForms controls. For example, provide a docking UI similar to Visual Studio using DockingTab, create an appointments calendar similar to Outlook with Scheduler, and deliver a complete Office 2010 menu system using Ribbon. These customizable controls can be easily modified to perfectly fit your application. § Advanced Charting Made Easy Chart for WinForms comes packed with all the charting functionality you need. You get over 80 chart types, designers for code-free development, flexible and customizable charting elements, visual effects, end-user interaction, advanced mouse-tracking capabilities, built-in analysis features and more. ComponentOne is also the only vendor to provide real 3D surface and contour charts. § Smarter Design-time Technology ComponentOne SmartDesigner® technology allows you to set the components most common properties and features without leaving the design surface. Set up your entire interface using the design-time wizards, property dialogs, smart tags, and context-sensitive toolbars provided by our SmartDesigner technology. § 300+ Unique Samples Studio for WinForms stands out from the pack with over 300 unique samples. These samples (C# and VB.NET), which install alongside the controls, show how to do all of the common tasks associated with each control to ease the learning curve. Studio for WinForms
Studio for WinForms 2012 v2 2/3
Studio for WinForms 2012 v2 2/3 C1StudioNet_2012v2.msi 共三个压缩分卷,请全部下载后解压 65+ .NET Windows Forms controls, including the ones you can't get anywhere else. Generate a
grid
with a million
rows
to a chart with unlimited points. Smart and Powerful WinForms Controls for Rapid UI Development Over 65 .NET Windows Forms controls, including the ones you can't get anywhere else. ComponentOne Studio® for WinForms controls come packed with smart, code-free designers, endless built-in features, superior flexibility, and the outstanding assurance that these controls will stand the test of time. What's Inside? § Chart § Flex
Grid
§ GanttView § Reports § Ribbon § True
DB
Grid
Why Choose Studio for WinForms? § Best Selling
Grid
s in the Market Since 1991 ComponentOne has been offering two award-winning
grid
s for creating Windows Client applications: Flex
Grid
and True
DB
Grid
. Each is designed to give you the best performance and features for different types of applications. Both
grid
s offer many out-of-the-box features like filtering, hierarchical data-binding, grouping, printing, and exporting to Microsoft Excel without any additional coding required. See a comparison. § All-in-one Reporting Solution With a rich object model for generating reports, several UI controls for previewing, and a report designer for creating and designing reports, Reports for WinForms is your all-in-one reporting solution. Generating cutting-edge reports for your .NET applications has never been easier. You can even integrate your existing reporting solutions (SQL Server, Access, Crystal) into your applications. § Mimic Popular Microsoft UIs and Layouts Replicate popular interfaces as seen in Microsoft Office and other programs using Studio for WinForms controls. For example, provide a docking UI similar to Visual Studio using DockingTab, create an appointments calendar similar to Outlook with Scheduler, and deliver a complete Office 2010 menu system using Ribbon. These customizable controls can be easily modified to perfectly fit your application. § Advanced Charting Made Easy Chart for WinForms comes packed with all the charting functionality you need. You get over 80 chart types, designers for code-free development, flexible and customizable charting elements, visual effects, end-user interaction, advanced mouse-tracking capabilities, built-in analysis features and more. ComponentOne is also the only vendor to provide real 3D surface and contour charts. § Smarter Design-time Technology ComponentOne SmartDesigner® technology allows you to set the components most common properties and features without leaving the design surface. Set up your entire interface using the design-time wizards, property dialogs, smart tags, and context-sensitive toolbars provided by our SmartDesigner technology. § 300+ Unique Samples Studio for WinForms stands out from the pack with over 300 unique samples. These samples (C# and VB.NET), which install alongside the controls, show how to do all of the common tasks associated with each control to ease the learning curve. Studio for WinForms
Studio for WinForms 2012 v2 3/3
Studio for WinForms 2012 v2 1/3 C1StudioNet_2012v2.msi 共三个压缩分卷,请全部下载后解压 65+ .NET Windows Forms controls, including the ones you can't get anywhere else. Generate a
grid
with a million
rows
to a chart with unlimited points. Smart and Powerful WinForms Controls for Rapid UI Development Over 65 .NET Windows Forms controls, including the ones you can't get anywhere else. ComponentOne Studio® for WinForms controls come packed with smart, code-free designers, endless built-in features, superior flexibility, and the outstanding assurance that these controls will stand the test of time. What's Inside? § Chart § Flex
Grid
§ GanttView § Reports § Ribbon § True
DB
Grid
Why Choose Studio for WinForms? § Best Selling
Grid
s in the Market Since 1991 ComponentOne has been offering two award-winning
grid
s for creating Windows Client applications: Flex
Grid
and True
DB
Grid
. Each is designed to give you the best performance and features for different types of applications. Both
grid
s offer many out-of-the-box features like filtering, hierarchical data-binding, grouping, printing, and exporting to Microsoft Excel without any additional coding required. See a comparison. § All-in-one Reporting Solution With a rich object model for generating reports, several UI controls for previewing, and a report designer for creating and designing reports, Reports for WinForms is your all-in-one reporting solution. Generating cutting-edge reports for your .NET applications has never been easier. You can even integrate your existing reporting solutions (SQL Server, Access, Crystal) into your applications. § Mimic Popular Microsoft UIs and Layouts Replicate popular interfaces as seen in Microsoft Office and other programs using Studio for WinForms controls. For example, provide a docking UI similar to Visual Studio using DockingTab, create an appointments calendar similar to Outlook with Scheduler, and deliver a complete Office 2010 menu system using Ribbon. These customizable controls can be easily modified to perfectly fit your application. § Advanced Charting Made Easy Chart for WinForms comes packed with all the charting functionality you need. You get over 80 chart types, designers for code-free development, flexible and customizable charting elements, visual effects, end-user interaction, advanced mouse-tracking capabilities, built-in analysis features and more. ComponentOne is also the only vendor to provide real 3D surface and contour charts. § Smarter Design-time Technology ComponentOne SmartDesigner® technology allows you to set the components most common properties and features without leaving the design surface. Set up your entire interface using the design-time wizards, property dialogs, smart tags, and context-sensitive toolbars provided by our SmartDesigner technology. § 300+ Unique Samples Studio for WinForms stands out from the pack with over 300 unique samples. These samples (C# and VB.NET), which install alongside the controls, show how to do all of the common tasks associated with each control to ease the learning curve. Studio for WinForms
ComponentOne 2012 V2 Studio for WinForms(完整安装版本)
ComponentOne 2012 V2 Studio for WinForms 2012 v2 1/3 C1StudioNet_2012v2.msi 65+ .NET Windows Forms controls, including the ones you can't get anywhere else. Generate a
grid
with a million
rows
to a chart with unlimited points. Smart and Powerful WinForms Controls for Rapid UI Development Over 65 .NET Windows Forms controls, including the ones you can't get anywhere else. ComponentOne Studio® for WinForms controls come packed with smart, code-free designers, endless built-in features, superior flexibility, and the outstanding assurance that these controls will stand the test of time. What's Inside? § Chart § Flex
Grid
§ GanttView § Reports § Ribbon § True
DB
Grid
§ § § § § § § § § § § § § § § § § § § § § § § § Show More Why Choose Studio for WinForms? § Best Selling
Grid
s in the Market Since 1991 ComponentOne has been offering two award-winning
grid
s for creating Windows Client applications: Flex
Grid
and True
DB
Grid
. Each is designed to give you the best performance and features for different types of applications. Both
grid
s offer many out-of-the-box features like filtering, hierarchical data-binding, grouping, printing, and exporting to Microsoft Excel without any additional coding required. See a comparison. § All-in-one Reporting Solution With a rich object model for generating reports, several UI controls for previewing, and a report designer for creating and designing reports, Reports for WinForms is your all-in-one reporting solution. Generating cutting-edge reports for your .NET applications has never been easier. You can even integrate your existing reporting solutions (SQL Server, Access, Crystal) into your applications. § Mimic Popular Microsoft UIs and Layouts Replicate popular interfaces as seen in Microsoft Office and other programs using Studio for WinForms controls. For example, provide a docking UI similar to Visual Studio using DockingTab, create an appointments calendar similar to Outlook with Scheduler, and deliver a complete Office 2010 menu system using Ribbon. These customizable controls can be easily modified to perfectly fit your application. § Advanced Charting Made Easy Chart for WinForms comes packed with all the charting functionality you need. You get over 80 chart types, designers for code-free development, flexible and customizable charting elements, visual effects, end-user interaction, advanced mouse-tracking capabilities, built-in analysis features and more. ComponentOne is also the only vendor to provide real 3D surface and contour charts. § Smarter Design-time Technology ComponentOne SmartDesigner® technology allows you to set the components most common properties and features without leaving the design surface. Set up your entire interface using the design-time wizards, property dialogs, smart tags, and context-sensitive toolbars provided by our SmartDesigner technology. § 300+ Unique Samples Studio for WinForms stands out from the pack with over 300 unique samples. These samples (C# and VB.NET), which install alongside the controls, show how to do all of the common tasks associated with each control to ease the learning curve. Studio for WinForms
VB基础类
7,759
社区成员
197,606
社区内容
发帖
与我相关
我的任务
VB基础类
VB 基础类
复制链接
扫一扫
分享
社区描述
VB 基础类
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章