MshFlexGrid关于手工录入数据,增行,删行,输出,等问题

xucome 2007-10-12 09:22:44
MshFlexGrid
想实现:
A.第一列可以让我自己填入个编码,当我填入某个编码后,后面的相关内容就自己带出来.
B.实现删行和增行.
C.把表的内容输出到Excel表
最好能写成实例.QQ:5798877
...全文
181 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
tianhuo_soft 2007-10-12
  • 打赏
  • 举报
回复
MSHFlexGrid控件
MSHFlexGrid控件显示和操作表格数据。其对包含字符串和图片的表格提供了灵活的排序、插入数据和格式编排功能。当与Data控件绑定时,MSHFlexGrid控件只显示只读数据。
你可以在MSHFlexGrid中的任何单元放置文本、图片或这二者。Row和Col属性指定MSHFlexGrid控件的当前单元。你可以在代码中指定当前单元,也可以在运行时使用鼠标或键盘改变当前单元。Text属性引用了当前单元中的文本。
如果单元中的文本太长以致不能在单元中一行显示,将WordWrap属性置为True将在单元中分多行显示文本。要在单元中显示多行文本,你需要增大单元的宽度(ColWidth属性)或行高度(RowHeight属性)。
使用Col和Row属性确定MSHFlexGrid控件中的行数和列数。使用Band属性确定MSHFlexGrid中的band风格。
属性
OLEDropMode属性(ActiveX控件),Height, Width属性(ActiveX控件),Index属性(ActiveX控件),Left, Top属性(ActiveX控件),Tag属性(ActiveX控件),Visible属性(ActiveX控件),Object属性(ActiveX控件),DataMember属性(ActiveX控件),Collapse事件(MSHFlexGrid),CollapseAll方法(MSHFlexGrid,ColPos属性,ColPositon, RowPosition属性,Cols, Rows属性(MSHFlexGrid),ColSel, RowSel属性,ColWidth属性(MSHFlexGrid),DataField属性(MSHFlexGrid),FillStyle属性(MSHFlexGrid),FixedCols, FixedRows属性(MSHFlexGrid),FocusRect属性,Font, FontBand, FontFixed, FontHeader属性(MSHFlexGrid),FontWidth, FontWidthBand, FontWidthFixed,FontWidthHeader属性(MSHFlexGrid),ForeColor, ForeColorBand, ForeColorFixed,ForeColorHeader, ForeColorSel属性,FormatString属性,GridColor, GirdColorBand,GridColorFixed, GridColorHeader, GridColorIndent, GridColorUnpopulated属性,GridLines, GridLinesBand, GridLinesFixed, GridLinesHeader, GridLinesIndent,GridLineUnpopulated属性(MSHFlexGrid),GridLineWidth, GridLineWidthBand,GridLineWidthFixed,GridLineWidthHeader,GridLineWidthIndent,GridLineWidthUnpopulated属性(MSHFlexGrid),HighLight属性(MSHFlexGrid),LeftCol属性(MSHFlexGrid),MergeCells属性(MSHFlexGrid),MergeCol, MergeRow属性,MouseCol, MouseRow属性,Name属性(MSHFlexGrid),Picture属性(MSHFlexGrid),PictureType属性,Redraw属性,RowExpandable,RowExpanded属性,RowHeight属性(MSHFlexGrid),RowHeightMin属性,RowIsVisible属性,RowPos属性,RowSizingmode属性,ScrollBars属性(MSHFlexGrid),ScrollTrack属性,SelectionMode属性,Sort属性(MSHFlexGrid),Text属性(MSHFlexGrid),TextArray属性,TextMatrix属性,TextStyle, TextStyleBand,TextStyleFixed, TextStyleHeader属性(MSHFlexGrid),TopRow属性(MSHFlexGrid),Version属性(MSHFlexGrid),WordWrap属性(MSHFlexGrid),AllowBigSelection属性,AllowUserResizing属性,BackColorIndent,BackColor, BackColorBkg,BackColorFixed, BackColorSel属性,BackColorBand,BackColorHeader,BackColorIndent,BackColorUnpopulated属性,BandColIndex属性(MSHFlexGrid),BandPisplay属性(MSHFlexGrid),BandExpandable属性(MSHFlexGrid),BandIndert属性(MSHFlexGrid),BandLevel属性(MSHFlexGrid),BandLevel属性(MSHFlexGrid),Bands属性(MSHFlexGrid),CellAlignment属性,CellBackColor, CellForeColor属性,CellFontBold属性,CellFontItalic属性,CellFontName属性,CellFontSize属性,CellFontStrikeThrough属性,CellFontUnderline属性,CellFontWidth属性,CellHeight, CellLeft, CellTop,CellWidth属性(MSHFlexGrid),CellPicture属性,CellPictureAlignment属性,CellTextStyle属性,ColAlignmentFixed属性,Clip属性(MSHFlexGrid),Col, Row属性(MSHFlexGrid),ColAlignment, ColAlignmentBand, ColAlignmentHeader属性(MSHFlexGrid),CellType属性,ColData, RowData, BandData属性(MSHFlexGrid),ColHeader属性(MSHFlexGrid),ColHeaderCaption属性,ColIsVisible属性,DataBindings属性,TabIndex属性,DragIcon属性,DragMode属性,MouseIcon(ActiveX控件)属性,TabStop属性,HelpContextID属性,Parent属性,Container属性,Recorset属性,WhatsThisHelpID属性,Appearance属性(ActiveX控件),BorderStyle属性(ActiveX控件),Enabled属性(ActiveX控件),DataSource属性(ActiveX控件),hWnd属性(ActiveX控件),MousePointer属性(ActiveX控件),ToolTipText属性(ActiveX控件)。
方法
OLEDrag方法(ActiveX控件),Refresh方法(ActiveX控件),CollapseAll方法(MSHFlexGrid),ExpandAll方法(MSHFlexGrid),RemoveItem方法(MSHFlexGrid),AddItem方法(MSHFlexGrid),Clear方法(MSHFlexGrid),ClearStructure方法(MSHFlexGrid),SelFocus方法,Drag方法,Move方法,ZOrder方法,ShowWhatsThis方法。
事件
RowColChange事件(MSHFlexGrid),Scroll事件(MSHFlexGrid),SelChange事件(MSHFlexGrid),Collapse事件,Compare事件,EnterCell事件,Expand事件(MSHFlexGrid),LeaveCell事件,DragDrop事件,DragOver事件,GotFocus事件,LostFocus事件,MouseDown, MouseUp事件,MouseMove事件,OLECompleteDrag事件(ActiveX控件),OLEDragDrop事件(ActiveX控件),OLEDragOver事件(ActiveX控件),OLEGiveFeedback事件(ActiveX控件),OLESetData事件(ActiveX控件),OLEStartDrag事件(ActiveX控件),Click事件(ActiveX控件),KeyDown, KeyUp事件(ActiveX控件),KeyPress事件(ActiveX控件)。
tianhuo_soft 2007-10-12
  • 打赏
  • 举报
回复
MSHFlexGrid Control


The Microsoft Hierarchical FlexGrid (MSHFlexGrid) control displays and operates on tabular data. It allows complete flexibility to sort, merge, and format tables containing strings and pictures. When bound to a data control, MSHFlexGrid displays read-only data.

Syntax

MSHFlexGrid

Remarks

You can place text, a picture, or both in any cell of an MSHFlexGrid. The Row and Col properties specify the current cell in an MSHFlexGrid. You can specify the current cell using code, or the user can change it at run time using the mouse or the arrow keys. The Text property references the contents of the current cell.

If the text in a cell is too long to display in the cell, and the WordWrap property is set to True, the text wraps to the next line within the same cell. To display the wrapped text, you may need to increase the cell’s column width (ColWidth property) or row height (RowHeight property).

Use the Col and Row properties to determine the number of columns and rows in an MSHFlexGrid. Use the Band properties to determine the band styles in an MSHFlexGrid.

Displaying Hierarchical Recordsets
A major feature of the MSHFlexGrid control is its ability to display hierarchical recordsets—relational tables displayed in a hierarchical fashion. The easiest way to create a hierarchical recordset is to use the Data Environment designer and assign the DataSource property of the MSHFlexGrid control to the Data Environment. You can also create a hierarchical recordset in code using a Shape command as the RecordSource for an ADO Data Control, as shown in the example below:

' Create a ConnectionString.
Dim strCn As String
strCn = "Provider=MSDataShape.1;Data Source=Nwind;" & _
"Connect Timeout=15;Data Provider=MSDASQL"

' Create a Shape command.
Dim strSh As String
strSh = "SHAPE {SELECT * FROM `Customers`} AS Customers " & _
"APPEND ({SELECT * FROM `Orders`} AS Orders RELATE " & _
"CustomerID TO CustomerID) AS Orders"

' Assign the ConnectionString to an ADO Data Control's
' ConnectionString property, and the Shape command to the
' control's RecordSource property.
With Adodc1
.ConnectionString = strCn
.RecordSource = strSh
End With
' Set the HflexGrid control's DataSource property to the
' ADO Data control.
Set HFlexGrid1.DataSource = Adodc1

guyehanxinlei 2007-10-12
  • 打赏
  • 举报
回复
这个都不是很难的
东方之珠 2007-10-12
  • 打赏
  • 举报
回复
参见:
http://topic.csdn.net/t/20030429/20/1723533.html

1,453

社区成员

发帖
与我相关
我的任务
社区描述
VB 控件
社区管理员
  • 控件
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧