您的位置:程序门 -> vb ->



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


[收藏此页] [打印本页]选择字色:背景色:字体:[][][]


mshflexgrid关于手工录入数据,增行,删行,输出,等问题[已结贴,结贴人:xucome]
发表于:2007-10-12 09:22:44 楼主
mshflexgrid
想实现:
a.第一列可以让我自己填入个编码,当我填入某个编码后,后面的相关内容就自己带出来.
b.实现删行和增行.
c.把表的内容输出到excel表
最好能写成实例.qq:5798877
发表于:2007-10-12 15:31:411楼 得分:50
参见:
http://topic.csdn.net/t/20030429/20/1723533.html
发表于:2007-10-12 16:22:182楼 得分:10
这个都不是很难的
发表于:2007-10-12 17:02:083楼 得分:20
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

发表于:2007-10-12 17:02:364楼 得分:20
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控件)。    


快速检索

最新资讯
热门点击