请问点击listview中caption里的checkbox的事件是什么?

danrushui 2003-08-19 06:22:44
当点击listview一列中的事件为listclick(),请问点击里面的checkbox的事件是什么?怎么不和listclick一致?
...全文
45 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
liuziran 2003-08-24
  • 打赏
  • 举报
回复
有了一段代码,测试一下,基本可行
procedure TForm7.ListView1Click(Sender: TObject);
const
ItemIndent =4;
CheckBoxSize =16;
var
I :Integer;
P :TPoint;
AItem :TListItem;
R1, R2 : TRect;
begin
with ListView1 do
begin
P :=ScreenToClient(Mouse.CursorPos);
AItem := GetItemAt(P.X, P.Y);
if AItem <>nil then
begin
R1 :=AItem.DisplayRect(drSelectBounds);
R2 :=Rect(ItemIndent, R1.Top, ItemIndent + CheckBoxSize, R1.Top + CheckBoxSize);
if ptInRect(R2, P) then
if AItem.Checked then
ShowMessage(Format('Item[%d] is Checked',[AItem.Index]))
else
ShowMessage(Format('Item[%d] is not Checked',[AItem.Index]));
end;
end;
end;
danrushui 2003-08-20
  • 打赏
  • 举报
回复
我的是d6,不是我一个人这样,我的一个同事也是这样。找了好些资料,到现在还搞清楚。
huojiehai 2003-08-19
  • 打赏
  • 举报
回复
To楼主,按你的设置(listview的类型为viewtype为vsReport)我试过,可以的呀,是不是你的Delphi有问题,我的是D5
DWGZ 2003-08-19
  • 打赏
  • 举报
回复
可以截获LVM_SETITEMSTATE消息, 你试试吧我要回家了
danrushui 2003-08-19
  • 打赏
  • 举报
回复
还有一点是listview的类型为viewtype为vsReport的。
danrushui 2003-08-19
  • 打赏
  • 举报
回复
不行的。工试过好几次了。点击checkbox时并没触发listviewclick()事件。
huojiehai 2003-08-19
  • 打赏
  • 举报
回复
有能在OnClick上做
procedure TForm1.ListView1Click(Sender: TObject);
begin

end;
Delphi VCLSkin 5.30 website : http://www.link-rank.com email : info@link-rank.com VCLSkin is a component to create skinnable user interface for Delphi/C++Builder application, It is easy to use, just put one component on mainform, Vclskin will skin whole application without source code modification. Vclskin is leader in this field, Vclskin support most third-part controls in market, there isn't a competitor was able to support 3rd-part controls as many as Vclskin. VclSkin automatically skin kinds of windows in application, include Delphi forms,MDIform and common Windows dialogs (MsgBox,Open/Save,Font,Print), even the Exception MsgBox. Vclskin not only support Delphi standard controls, but also support many third-party component, such as TMS Grid pack, EnLib Grid, Developer Express QuantumGrid. It is an excellent choice for those wanting to skin existing applications. The cool thing is that it uses existing VCL components. -Install Run install.exe to install. You also get help in help.chm -Demo The demo package download at: http://www.link-rank.com/download.htm Demo version adds a string 'VclSkin demo' on form caption, but allows to test all available functions. -History News In 5.30 05/20/2009 *Fix bugs in windows 7. News In 5.25 04/14/2009 *Add xoCaptionButtonHint in skindata.options to hide hint of caption button, to upgrade new version: 1 run uninstall.exe in demo package. 2 compile and install new version. News In 5.20 03/05/2009 *fix problem on hint on caption button. News In 5.14 11/04/2008 *fix unicode problem in delphi 2009 News In 5.12 11/04/2008 *fix bug in hint for caption button News In 5.11 11/03/2008 *support hint for caption button News In 5.10 09/17/2008 *support delphi 2009 News In 5.04 08/16/2008 *fix bug in BCB2007. News In 5.1 05/29/2008 *fix bug in TBitbtn. News In 4.99 05/07/2008 *fix bug in Tprogressbar. News In 4.98 04/23/2008 *fix bug in Tbutton. News In 4.97 04/20/2008 *fix bug in Tlistview. News In 4.96 03/25/2008 *fix bug in Tlistview. News In 4.95 03/13/2008 *fix bug in dll forms. News In 4.94 11/13/2007 *Skip to skin control in Skindata.OnSkinControl event. News In 4.93 11/13/2007 *Support PNGspeedbutton. News In 4.92 11/06/2007 *Fix combobox button problem when form is scaled. News In 4.91 10/02/2007 *Support QuantumGrid 6. News In 4.90 09/03/2007 *Support C++builder 2006, c++builder 2007. News In 4.89 07/26/2007 *Fix problem with Multilizer . News In 4.88 07/18/2007 *Fix form icon problem . News In 4.87 07/10/2007 *Fix problem in Form Caption News In 4.86 06/13/2007 *Fix problem in TDateTimePicker News In 4.85 06/06/2007 *Fix problem in TDateTimePicker News In 4.83 05/18/2007 *Fix problem in Dev Dbtreeview. News In 4.82 05/11/2007 *Improve image quality of form icon. News In 4.81 04/30/2007 *Fix menu border problem. News In 4.80 04/20/2007 *Fix menu border problem in windows2000. News In 4.76 04/11/2007 *Support application Icon updated at runtime. News In 4.75 04/04/2007 *Fix default button problem. News In 4.72 02/27/2007 *Fix form paint problem when cpation changed. News In 4.60 02/09/2007 *Support Help button in form system button. News in 4.55 01/31/2007 *Fix problem that right click caption on Dll form. News in 4.53 01/22/2007 *Fix problem on multi-lines caption header in Listview. News in 4.52 01/11/2007 *Fix problem in DatetimePicker when it resize. News in 4.50 01/03/2007 *Fix problem work with Billenium Effects. News in 4.42 12/06/2006 *skindata.skincontrols option work in window common dialog. News in 4.41 11/13/2006 *fix problem in TImageEnOpendialog. News in 4.40 11/09/2006 *fix problem with Billenium Effects. News in 4.36 10/21/2006 *Fix popupmenu problem in win98 . News in 4.35 10/20/2006 *Fix problem when combobox right-to-left . News in 4.33 10/11/2006 *Fix problem when checkbox and radiobutton is right-to-left reading . News in 4.32 10/03/2006 *Fix problem of button shortcut. News in 4.31 9/25/2006 *Support Toolbarwindow32 in Opendialog. News in 4.30 9/7/2006 *Fix Caption problem in bidiRighttoLeft form. News in 4.25 9/5/2006 *Fix Mainmenu problem in MDIform with bidiRighttoLeft. News in 4.22 8/28/2006 *Fix problem when Menuitem text is right-to-left reading . News in 4.21 8/21/2006 *Fix problem when form caption is right-to-left reading . News in 4.20 8/18/2006 *Fix problem when form Max/Min button is disable. *Change skin file format. News in 4.13 8/14/2006 *unskin dialog when download file in webbrowser. News in 4.12 7/30/2006 *Fix problem when form Max/Min button is disable. News in 4.11 6/25/2006 *Change Grid.fixedcolor when skin file changed. News in 4.10 6/14/2006 *Add BeforeFormSkin and AfterFormSkin event. News in 4.09 6/07/2006 *fix bug in MDIchild when form create and change form caption. News in 4.08 5/25/2006 *(5/26)Fix bug in TSkinControl.GetParentColor . *Change Tabcontrol background color. News in 4.07 5/10/2006 *Fix problem TScrollbar control. News in 4.07 5/5/2006 *Fix problem in Mainmenu. News in 4.06 4/19/2006 *Fix combobox scrollbar problem. News in 4.05 4/18/2006 *Fix scrollbar problem when grid is disable. *Fix Mainmenu problem in Windows95 News in 4.04 4/10/2006 *Fix Mainmenu problem in MDIform. *Fix Menu merge problem in Win98. News in 4.03 4/01/2006 *Fix problem in TCheckbox and TRadiobutton when BiDimode=bdRighttoLeft. *Fix problem when Menuitems have Actions. News in 4.02 3/28/2006 *Fix problem in TSpeedbutton when size is zero. *Support scrollbar in drop-down of combobox. News in 4.01 3/16/2006 *fix problem with trackbar when skin active *support TCategoryButtons in delphi2006 News in 4.0. 3/9/2006 *Fix problem when skin file do not have checkbox image. *Fix bug when click button and move mouse. *Fix bug with TVirtualTreeview. News in 3.99 3/3/2006 *Fix bug when skindata.skinformtype=sfOnlyThisForm *Fix bug in TcxRadioGroup *Fix bug in TDateTimePicker *Fix bug in TMediaPlayer. News in 3.98 2/24/2006 * Support TPageControl with tsButton style. * Fix problem on Mainmenu with ActionList. News in 3.97 2/16/2006 * Fix problem when Groupbox in ScrollBox. *Fix problem with newest TNTcontrol. News in 3.96 2/6/2006 * Fix problem with TTrayIcon. * Fix problem bug with TMainmenu. News in 3.95 1/25/2006 * Fix flicker problem about TSpeedbutton. * Fix flicker problem when form caption change. News in 3.94 1/25/2006 * Fix bug in TPopupMenu. add 'xoMenuBG' in skindata.options to support menuitem with mbBarBreak. News in 3.93 1/18/2006 * Fix bug in TDateTime. News in 3.92 1/12/2006 * Fix paint bug in TTabcontrol. * Fix paint bug in Checkbox and radiobutton without caption . News in 3.91 1/8/2006 * Fix bug in Mainmenur. News in 3.90 1/1/2006 * Fix bug in TrackBar. News in 3.89 12/31/2005 * Fix bug in form with BorderStyle=bsNone. *Fix mainmenu bug in MDIForm. News in 3.88 12/26/2005 *Fix bug in THeaderControl. *Support TcxTreeList, TcxNavigator in Dev express controls. News in 3.87 12/22/2005 *Paint minimized form. *Fix bug in TPageControl. News in 3.85 12/13/2005 *Fix a crush bug. News in 3.84 12/5/2005 *Support TPnbBitBtn. *fix flicker in Tpagecontrol. *Fix GDI leak problem. News in 3.83 12/2/2005 *Fix problem that toolbar Backbround is too dark . News in 3.82 12/1/2005 *Fix bug when form maximize. News in 3.81 11/29/2005 *Support TMediaPlayer control. News in 3.80 11/20/2005 *Fix some skin files. *Fix bug on ImageEn SaveImageEnDialog. News in 3.72 11/10/2005 *Fix bug in TScrollbar when its min is negative. *Fix bug in Tmainmenu. News in 3.71 11/5/2005 *change caption text color to gray when checkbox or radiobutton is disable. *Fix paint problem in Tbitbtn when caption is empty. *Fix bug of changing skin file when Skindata.SkinFormtype = sfOnlyThisForm. News in 3.70 10/27/2005 *Support TAdvPageControl. *Support TRzMenuButton, TcxButton with cxbkDropDownButton. *work with RECREATEWND message for skined control has scrollbar. *Fix a memory leak bug. *Fix paint bug for TPagecontrol in win95. News in 3.65 10/21/2005 *Add TSkindata.Options.xoMDIChildBorder which do not skin MDIChild form's border. News in 3.64 10/19/2005 *Fix problem when skindata.skincontrols.xcMainMenu is flase. News in 3.63 10/15/2005 *Support THeaderControl. News in 3.62 10/13/2005 *fix bug in SystemMenu. News in 3.61 10/11/2005 *fix bug in TcxDbCheckbox. *fix paint problem in Tcheckbox when Alignment is taLeftJustify. News in 3.60 10/10/2005 *Vclskin can run in Win95. News in 3.52 10/6/2005 *Fix paint problem of form border. News in 3.51 10/4/2005 *Fix paint problem in checkbox with big image. News in 3.50 9/25/2005 *Support Mouse Hover in Scrollbar. *Add Mouse thumb gripper in Scrollbar. News in 3.41 *Fix some problem in Button when mouse move. News in 3.40 2005.9.21 *Support Hover state in Header control. *Improve on TrackBar *Fix problem to unskin radiogroup. News in 3.38 2005.9.13 *Fix icon problme in MDIChild. News in 3.37 2005.9.12 *Fix font color problem in TButton when button is focused. News in 3.36 2005.9.9 *Fix font color problem in Tgroupbox,radiobutton,checkbox. News in 3.35 2005.9.5 *Support TGroupbox font color. News in 3.34 2005.8.31 *Fix paint problem in Trackbar when skin file change. News in 3.33 2005.8.29 *Fix problem in TcxDBCheckbox. News in 3.32 2005.8.25 *Add close button on TPageControl. News in 3.31 *fix problem when righ click form caption that BorderIcons:=[] News in 3.30 *fix problem that show normal window border when windows first show. *fix resize problem when form border is bsSingle. News in 3.29 *System menu is NOT only English.It support Language in windows. *Fix some problem in DLL applicaton. News in 3.28 * fix paint bug in checkbox and radiobutton in windows common dialog. News in 3.27 *fix bug in TTntDateTimePicker. *fix paint problem in TPageControl. News in 3.26 *Support Popupmenu in TFrame. News in 3.25 * fix Icon problem in MDIChild form. * fix caption paint problem in MDIForm. News in 3.24 * Fix Icon problem in MDIChild form. * fix paint problem in Tbitbtn. * Add feature that Skin file Preview image saved in skin-builder. * Add xcTrackbar and xcSpin. News in 3.23 * Support wordwrap in Bitbtn and speedbutton. * Fix scrollbar problem in TImageScrollBox. News in 3.22 * fix transparent problem in button. News in 3.21 * Fix paint problem in TSpidEdit. * Support owner-MeasureItem event in Popupmenu. News in 3.20 * support toolbar background. * support workwrap in checkbox and radiobutton. News in 3.14 *fix mainmenu merge problem . *fix flicker problem in transparent background . News in 3.13 *fix scrollbar problem when form move. *fix bug in DLL form. *fix Edit control focus problem in MDIChild. *fix formresize problem when skin file change. News in 3.12 * Add Focus border on checkbox,radiobutton,button. * Support Transparent Background on Checkbox,Radiobutton,Groupbox. * Support WS_EX_APPWINDOW style. * fix MDIchild problem in TBX. * improve on RzRadiobutton. News in 3.11 *Support runtime package. *support ALT,ALT-Space. *support hint for scrollbar control *fix Z-order problem when skin change. *fix shortcut problem. News in 3.10 *Support TBX. *Support TNT MDIChild Form. *Support more FastReprt button control. News in 3.08 *Fix problem in TOpenImageEnDialog. *Paint Border in scrollbar control. *Fix checkbox paint problem in Dibiright *Fix Tscrollbox problem. *Support LMD Elpack. *Fix problem that Control without parent. *Fix bug in skin file change. News in 3.07 *Fix problem when BiDiRight Mainmenu popup. *Fix bug in 3.06,3.05 when skin remove at runtime. News in 3.06 *Fix bug in C++Builder. *Fix bug in scrollbar resize. *Fix bug in Delphi7 XPmanifest component. News in 3.05 *Fix bug when move controls in different forms. *Fix problem in TStatusbar that is simple and DiBiRight. News in 3.04 *Fix Tscrollbox problem in delphi5. *Fix Mainmenu display problem in BIDIRight. *Fix font color problem in TSpeedbutton when it is disable. *Fix bug in TntCombobox. *Fix skinfile mxskin59.skn when form is maximized. News in 3.03 *Fix bug in dockable form. *Support Tbutton onMouseDown event. News in 3.02 *Fix Combobx problem in BIDIRight. *Fix MOUSE WHEEL problem in Tlistbox. *Fix Scrollbar problem when control is invisible. News in 3.01 *Fix problem in Inherited-MDIchild. News in 3.0 *Scrollbar flicker problem fixed. *Redundant separator bars in menu are automatically removed. *Add xoMDIScrollbar to show scrollbar in MDIClient area. News in 2.77 * Support TspinButton. * Support TRzDBCheckbox. * Fix paint problem when MDIform lost focus. * Fix AV bug in application close; * Fix bug when change skin file in multi-skins application. * Fix problem about skin delay. News in 2.76 * 4 new skin file released. * fix some bug in Opendialog. News in 2.75 * Fix bugs in IP4000 combobox * Add install.exe and uninstall.exe * Add "embedscrollbar" in Skindata.skin3rd to support TAdvpanelGroup's scrollbar. * Fix Colorpicker Popupmenu problem in WwRichEdit form. * Support SpinEdit now. * Fix TScrollbox problem in delphi5 or c++builder5. News in 2.74 * Delphi 2005 support. * Enable/Disable skin control at runtime. * Fix bug in MDIForm menu merge. * Add "xcMenuitem" in skincontrols property. * skip to skin QuickReport preivew form. News in 2.73 * Fix bugs in MDIForm when MDIChild is maximized. * Fix bug of form Caption in Chinese. News in 2.72 * Support TNT Unicode Controls . * Support menu in Tookbar2000 . * fix bug in MDIform close. * fix bug in TScrollbar control. * fix bug in TDateTimePicker when TDateTimePicker.kind is dtkTime. News in 2.71 * fix bugs of MDIChild form. * support progressbar with pbVertical style. * support preset color in skin file. * support speedbutton in skin3rd property. News in 2.70 * fix bug in embeded form. * fix bug of MDIform with Expressbar. * fix bug of form caption refresh when skin change. * fix trackbar refresh bug when skin change. * fix Quickreport , reprotbuilder preview form problem. * Support Raize TRzbitbtn with ImageList. * Support TComboboxex. News in 2.69 *Support Raize TRzbitbtn with glyph. *Support TMS TAdvMemo. *Fix bug of mainmenu shortcut in MDIform. News in 2.68 *Fix bugs in mainmenu. *Fix Icon bug in dialog. News in 2.67 *Fix DBEdit paint bug. *Fix Icon paint bug. News in 2.66 *Use Memory Inifile. *Fixed bug in multiskin demo. *Fixed MDIform Tile and Cascade problem. *Fixed bugs in default button and disable button. *Add LMD tools 7.0 demo. News in 2.65 *Paint with gray glyph when Speendbtn is disable. *Fixed Topendialog resize problem *Fixed shortcut problem in menuitem. *Add Raized component demo. *Add QuantumGrid4 demo. *Add IP4000 demo. News in 2.62 *Paint TGroupbox with new style. *Fixed bug in painting TSpeedbutton pictures. *Fixed bug in application closed. News in 2.60 *Support Arabic language, BiDiMode is righttoleft. *Fixed some bugs when application closed. News in 2.55 *Fixed bug that Tspeedbutton destory at runtime. *Improve performance when change menutitem at runtime. *Fixed OpenDialog bug. News in 2.50 *Support LMD tools. *Fixed bug of checkbox that is disabled . *Add TSkindata.Skin3rd property to add 3rd control easily. News in 2.45 *Some bugs fixed. *Improve compatibility with Billenium effects. News in 2.4 *Support to skin an application but keep the menu bar and title bar the default Windows standard. *DBCheckbox bug fixed. *Fixed bug in cascade,tile command in MIDform. *Bug with minimized state when form created. *Suport ReportBuilder News in 2.3 *Support TUpDown and TSpinEdit. *Support TrackBar. *Restore form size when remove skin. *Fix more bugs. News in 2.25 *Fix bug with QuickReport and FastReport. *Fix bug in Tstatusbar. *Fix bug in Application. News in 2.20 *Support Header control in TlistView. *Fix Menuitem ShortCut bug. *Fix bug that change windows Z-Order when skin change at runtime. *Support Tframe created at runtime. News in 2.10 *Fix Scrollbar drag thumb problem. News in 2.05 *Support multi-skindata in application,Mainform and messagebox can use different skindate. *Nested form support. *Fixed Title flicker problem when form resize. *Support Mainmenu change at runtime. News in 2.0 *skin kinds of windows in your project, Delphi forms,MDIform and common Windows dialogs (MsgBox,Open/Save,Font,Print), even the Exception MsgBox. *Enable/Disable skin at runtime. *fixed many bugs in MDIform. *system menu enchanced.
Visual Basic 6编程技术大全 是非常详细和深入的Vb6学习教程,无论对初学者还是有经验的开发人员,都非常有帮助 第一部分基础篇1 第1章 VB6入门1 1.1 集成开发环境1 1.1.1 运行IDE1 1.1.2 选择工程类型1 1.1.3 IDE窗口2 1.1.4 菜单5 1.1.5 工具栏6 1.1.6 Toolbox7 1.2 第一个VB应用程序9 1.2.1 向窗体添加代码9 1.2.2 设置控件的属性10 1.2.3 为控件命名12 1.2.4 移动及重新调整控件尺寸13 1.2.5 设置Tab顺序13 1.2.6 添加代码14 1.2.7 运行和调试程序15 1.2.8 优化示例程序16 1.2.9 准备、编译、运行18 第2章关于窗体20 2.1 通用属性20 2.1.1 Left、Top、Width和Height属性21 2.1.2 ForeColor和BackColor属性21 2.1.3 Font属性23 2.1.4 Caption和Text属性24 2.1.5 Parent和Container属性25 2.1.6 Enabled和Visible属性25 2.1.7 hWnd属性26 2.1.8 TabStop和Tablndex属性26 2.1.9 MousePointer和Mouselcon属性27 2.1.10Tag属性28 2.1.11其他属性28 2.2 通用方法29 2.2.1 Move方法29 2.2.2 Refresh方法30 2.2.3 SetFocus方法30 2.2.4 ZOrder方法31 2.3 通用事件31 2.3.1 Click和DblClick事件31 2.3.2 Change事件32 2.3.3 GotFocus和LostFocus事件33 2.3.4 KeyPress、KeyDown和KeyUp事件33 2.3.5 MouseDown、MouseUp和 MouseMove事件35 2.4 Form对象37 2.4.1基本的Form属性37 2.4.2微调窗体的性能38 2.4.3 Form的生存期39 2.4.4 Controls集合43 2.4.5 Screen对象44 2.4.6打印文本45 2.4.7图形方法48 2.4.8 DrawMode属性51 2.4.9 ScaleMode属性54 2.4.10调色板支持56 第3章内部控件58 3.1TextBox控件58 3.1.1 运行时属性59 3.1.2捕获键盘活动60 3.1.3数字的校验例程61 3.1.4 CausesValidation属性和Validate事件63 3.1.5自动跳格字段65 3.1.6格式化文本65 3.1.7多行TextBox控件69 3.2 Label和Frame控件70 3.2.1 Label控件70 3.2.2 Frame控件71 3.3 CommandButton、CheckBox和 OptionButton控件71 3.3.1 CommandButton控件72 3.3.2 CheckBox控件72 3.3.3 OptionButton控件73 3.3.4使用图形化控件73 3.4 ListBox和ComboBox控件74 3.4.1 ListBox控件74 3.4.2 ComboBox控件81 3.5 PictureBox和Image控件83 3.5.1 PictureBox控件83 3.5.2 Image控件86 3.6滚动条控件86 3.7 DriveListBox、DirListBox和FileListBox控件89 3.8其他控件91 3.8.1Timer控件91 3.8.2 Line控件92 3.8.3 Shape控件92 3.8.4 OLE控件92 3.9菜单93 3.9.1运行时访问菜单94 3.9.2弹出式菜单95 3.10控件数组96 3.11共享事件过程97 3.11.1运行时创建控件97 3.11.2迭代控件数组的项目98 3.11.3菜单项数组98 第4章变量与过程100 4.1变量的作用域和生存期100 4.1.1全局变量100 4.1.2模块级的变量101 4.1.3动态局部变量102 4.1.4静态局部变量102 4.2内置数据类型概述103 4.2.1整型数据类型103 4.2.2长整型数据类型104 4.2.3布尔数据类型104 4.2.4字节数据类型104 4.2.5单精度数据类型104 4.2.6双精度数据类型105 4.2.7字符串数据类型105 4.2.8货币数据类型106 4.2.9日期数据类型106 4.2.10对象数据类型106 4.2.11变量数据类型107
Visual Basic 6编程技术大全 是非常详细和深入的Vb6学习教程,无论对初学者还是有经验的开发人员,都非常有帮助 第一部分基础篇1 第1章 VB6入门1 1.1 集成开发环境1 1.1.1 运行IDE1 1.1.2 选择工程类型1 1.1.3 IDE窗口2 1.1.4 菜单5 1.1.5 工具栏6 1.1.6 Toolbox7 1.2 第一个VB应用程序9 1.2.1 向窗体添加代码9 1.2.2 设置控件的属性10 1.2.3 为控件命名12 1.2.4 移动及重新调整控件尺寸13 1.2.5 设置Tab顺序13 1.2.6 添加代码14 1.2.7 运行和调试程序15 1.2.8 优化示例程序16 1.2.9 准备、编译、运行18 第2章关于窗体20 2.1 通用属性20 2.1.1 Left、Top、Width和Height属性21 2.1.2 ForeColor和BackColor属性21 2.1.3 Font属性23 2.1.4 Caption和Text属性24 2.1.5 Parent和Container属性25 2.1.6 Enabled和Visible属性25 2.1.7 hWnd属性26 2.1.8 TabStop和Tablndex属性26 2.1.9 MousePointer和Mouselcon属性27 2.1.10Tag属性28 2.1.11其他属性28 2.2 通用方法29 2.2.1 Move方法29 2.2.2 Refresh方法30 2.2.3 SetFocus方法30 2.2.4 ZOrder方法31 2.3 通用事件31 2.3.1 Click和DblClick事件31 2.3.2 Change事件32 2.3.3 GotFocus和LostFocus事件33 2.3.4 KeyPress、KeyDown和KeyUp事件33 2.3.5 MouseDown、MouseUp和 MouseMove事件35 2.4 Form对象37 2.4.1基本的Form属性37 2.4.2微调窗体的性能38 2.4.3 Form的生存期39 2.4.4 Controls集合43 2.4.5 Screen对象44 2.4.6打印文本45 2.4.7图形方法48 2.4.8 DrawMode属性51 2.4.9 ScaleMode属性54 2.4.10调色板支持56 第3章内部控件58 3.1TextBox控件58 3.1.1 运行时属性59 3.1.2捕获键盘活动60 3.1.3数字的校验例程61 3.1.4 CausesValidation属性和Validate事件63 3.1.5自动跳格字段65 3.1.6格式化文本65 3.1.7多行TextBox控件69 3.2 Label和Frame控件70 3.2.1 Label控件70 3.2.2 Frame控件71 3.3 CommandButton、CheckBox和 OptionButton控件71 3.3.1 CommandButton控件72 3.3.2 CheckBox控件72 3.3.3 OptionButton控件73 3.3.4使用图形化控件73 3.4 ListBox和ComboBox控件74 3.4.1 ListBox控件74 3.4.2 ComboBox控件81 3.5 PictureBox和Image控件83 3.5.1 PictureBox控件83 3.5.2 Image控件86 3.6滚动条控件86 3.7 DriveListBox、DirListBox和FileListBox控件89 3.8其他控件91 3.8.1Timer控件91 3.8.2 Line控件92 3.8.3 Shape控件92 3.8.4 OLE控件92 3.9菜单93 3.9.1运行时访问菜单94 3.9.2弹出式菜单95 3.10控件数组96 3.11共享事件过程97 3.11.1运行时创建控件97 3.11.2迭代控件数组的项目98 3.11.3菜单项数组98 第4章变量与过程100 4.1变量的作用域和生存期100 4.1.1全局变量100 4.1.2模块级的变量101 4.1.3动态局部变量102 4.1.4静态局部变量102 4.2内置数据类型概述103 4.2.1整型数据类型103 4.2.2长整型数据类型104 4.2.3布尔数据类型104 4.2.4字节数据类型104 4.2.5单精度数据类型104 4.2.6双精度数据类型105 4.2.7字符串数据类型105 4.2.8货币数据类型106 4.2.9日期数据类型106 4.2.10对象数据类型106 4.2.11变量数据类型107
没法下载,到这折腾一把试试。 本文由abc2253130贡献 doc文档可能在WAP端浏览体验不佳。建议您优先选择TXT,或下载源文件到本机查看。 C#(WINFORM)学习 一、 C#基础 基础 类型和变量 类型和变量 类型 C# 支持两种类型:“值类型”和“引用类型”。值类型包括简单类型(如 char、int 和 float 等)、枚举类型和结构类型。引用类型包括类 (Class)类 型、接口类型、委托类型和数组类型。 变量的类型声明 变量的类型声明 每个变量必须预先声明其类型。如 int a; int b = 100; float j = 4.5; string s1; 用 object 可以表示所有的类型。 预定义类型 下表列出了预定义类型,并说明如何使用。 类型 object 说明 所有其他类型的最终 基类型 字符串类型; 字符串是 Unicode 字符序列 8 位有符号整型 16 位有符号整型 32 位有符号整型 64 位有符号整型 示例 object o = null; 范围 string sbyte short int long string s = "hello"; sbyte val = 12; short val = 12; int val = 12; long val1 = 12; -128 到 127 -32,768 到 32,767 -2,147,483,648 2,147,483,647 -9,223,372,036,854,775,808 到 第1页 C#(WINFORM)学习 long val2 = 34L; 到 9,223,372,036,854,775,807 byte ushort 8 位无符号整型 16 位无符号整型 byte val1 = 12; ushort val1 = 12; uint val1 = 12; uint 32 位无符号整型 uint val2 = 34U; ulong val1 = 12; ulong val2 = 34U; ulong 64 位无符号整型 ulong val3 = 56L; ulong val4 = 78UL; float 单精度浮点型 float val = 1.23F;7 位 double val1 = 1.23; double 双精度浮点型 double val2 = ±5.0 × 10?324 ±1.7 × 10 308 0 到 255 0 到 65,535 0 到 4,294,967,295 0 到 18,446,744,073,709,551,615 ±1.5 × 10?45 ±3.4 × 10 38 到 到 4.56D;15-16 布尔型;bool 值或为 真或为假 字符类型;char 值是 一个 Unicode 字符 精确的小数类型, 具有 28 个有效数字 bool val1 = true; bool val2 = false; char val = 'h'; decimal val = bool char decimal DateTime ±1.0 × 10?28 ±7.9 × 10 28 到 1.23M;28-29 变量转换 简单转换: float f = 100.1234f; 可以用括号转换: short s = (short)f 也可以利用 Convert 方法来转换: string s1; s1=Convert.ToString(a); MessageBox.Show(s1); 常用 Convert 方法有: 第2页 C#(WINFORM)学习 C# Convert.ToBoolean Convert.ToByte Convert.ToChar Convert.ToDateTime Convert.ToDecimal Convert.ToDouble Convert.ToInt16 Convert.ToInt32 Convert.ToInt64 Convert.ToSByte Convert.ToSingle Convert.ToString Convert.ToUInt16 Convert.ToUInt32 Convert.ToUInt64 备注 Math 类 常用科学计算方法: C# Math.Abs Math.Sqrt Math.Ro
1 , vb5dialog.zipThis demonstrates how to subclass the Common Dialog Dialogs and manipulate a specific Dialog.2 , cpnl.zipForm_Taskbar is a control for Visual Basic which, once placed onto a form, makes the form act like the Taskbar (minus the Start Menu).3 , vbo_progbar.zipImplement a common control progress bar with added features that are not accessable using COMCTL32.OCX! 4 , vbo_infolabel.zipThis control adds a great user-friendly interface with and icon and "Hover" ability. Based on a control seen in ICQ. 5 , vbo_checkcombo.zipAdd a checkbox to a combo box and use it to enabled/disable the combo! or whatever you would like to do with it! 6 , vbo_controlframe.zipCreate your own system button such as a Maximize, Minimize, Close, and many others with ease! 7 , vbo_ctextbox.zipThis class makes using the Textbox or Edit class API simple. Easily set properties and access many features not available directly from VB. 8 , taskbar.zipForm_Taskbar is a control for Visual Basic which, once placed onto a form, makes the form act like the Taskbar (minus the Start Menu).9 , NT_Service.zipThis is an OCX that allows you to create an NT service application...add the control to your project and register it as a service!!10 , Scroller.zipThis is a Control Container, it's like a frame control but it lets you scroll the content up and down...11 , TrayArea.zipThis control lets you add your icon to the System Tray Area and handle some events such as MouseMove, MouseDown, MouseUp and DblClick.12 , Resizer.zipThis is a very useful control: It's a container control, you can insert two controls inside and then you'll have a vertical (or horizontal) resizer bar (like the Windows File Explorer). A resizer can contain another resizer... an so on. (you can divide you form in as many sizable sections as you want...).13 , Label3D.zipTh

5,388

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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