Time of Update: 2018-12-07
今天說說TNewCheckListBox類。該類和ListBox差不多,只是下面的項可以用CheckBox或者RadioButton選擇,是一種比較複雜的類型。該類繼承自TCustomListBox,自身具有以下屬性和函數: TNewCheckListBox = class(TCustomListBox) function AddCheckBox(const ACaption, ASubItem: String; ALevel: Byte; AChecked, AEnabled,
Time of Update: 2018-12-07
一、 需求的產生 很多時候,需要根據年月或日期來檢索資料。在我的資料庫中,如果只需要以月為單位,我一般按照200801這樣的格式(yyyyMM)儲存為int類型。在做資料檢索時,是根據工具列中的兩個ToolStripComboBox(一個年,一個月)選擇的資料合併成一個年月來檢索資料,但是使用者反映不夠方便和直觀,希望能夠使用日期控制項進行選擇。效果
Time of Update: 2018-12-07
這裡講講如何調用dll中的函數。先來一個簡單的例子:[code]varmyPage:TWizardPage;Button :TNewButton;Cnt:Integer;function GetCurrentProcessId(): Integer;external 'GetCurrentProcessId@C:\Windows\System32\kernel32.dll'; procedure ButtonOnClick(Sender: TObject);begin
Time of Update: 2018-12-07
本文轉自:http://www.cnblogs.com/tony-yang/archive/2009/06/03/learnserialport.html C#的SerialPort學習資料在網上已經有很多了,我在這裡主要是把我學習中用到的資料整理,歸類一下.首先我們學習的時候沒有串口硬體,那麼我們去找一個類比虛擬串口的工具我用的是VSPM.exe,http://www.skycn.com/soft/30517.html開始學習SerialPort,首先先來看看一些基礎知識 串口簡單講解串口是
Time of Update: 2018-12-07
方法一:View Code 本文轉載:http://dengzebo.blog.163.com/blog/static/18867406201032141742168/#region "讀取樹結點從Datatable" /// <summary> /// 讀取樹結點從Datatable" /// </summary> /// <param name="TreeView1">在填充的TreeView控制項&
Time of Update: 2018-12-07
許多程式在安裝過程中,會有升級的可能,但是又有個問題就是,當前的程式正在運行,這樣就不能達到升級的效果,因此有必要堅持並能夠結束指定程式的過程,如何在安裝包中實現呢?其實很簡單,就是調用dll,關於dll,可以用C++或者VB編寫,個人推薦用C++,這樣編寫的dll檔案似乎在資料類型上能夠和pascal更好地融合,代碼很簡單,這裡我就不囉嗦了,把重點集中到調用上,下面是一個例子:[code]var myPage:TWizardPage; Button
Time of Update: 2018-12-07
大體都是用兩次單擊的時間差來判斷一下是否是雙擊。SystemInformation.DoubleClickTime預設是500第一種方式:可以參考http://blog.csdn.net/zbssoft/article/details/5602658 DateTime lastDownTime = DateTime.Now; private void comboBox1_MouseDown(object sender, MouseEventArgs e)
Time of Update: 2018-12-07
這裡介紹一下FolderTreeView 類。TFolderTreeView = class(TCustomFolderTreeView) property OnChange: TNotifyEvent; read write; property OnRename: TFolderRenameEvent; read
Time of Update: 2018-12-07
在Winform中右鍵彈出Datagridview顯示列菜單已經有很多人做了,參看下面連結.http://www.codeproject.com/KB/grid/DGVColumnSelector.aspx源碼連結http://www.codeproject.com/KB/grid/DGVColumnSelector/DataGridViewColumnSelector_src.zip但當你的有很多很多列或你對你的列名們不是太熟悉就有些麻煩了,把要顯示的列勾選出來是一件很頭疼的事. 參考部落格:
Time of Update: 2018-12-07
private void treeView1_AfterCheck(object sender, TreeViewEventArgs e){ if (e.Action != TreeViewAction.ByMouse) return; SetParentNode(e.Node); SetChildNode(e.Node);}private void SetParentNode(TreeNode node){ if (node.Level > 0)
Time of Update: 2018-12-07
轉自:http://www.dreams8.com/thread-6595-1-1.html因時間問題,代碼格式沒有整理,請諒解。本文:記錄一下自己在學習inno時候遇到的一些問題,以及涉及到code段代碼問題,方便自己和大家尋找解決問題。 1 、如何讓協議許可頁面預設選中我同意按鈕[code]procedure InitializeWizard();beginWizardForm.LICENSEACCEPTEDRADIO.Checked :=
Time of Update: 2018-12-07
#region 節點拖拽事件 //當使用者開始拖動節點時 private void tvModel_ItemDrag(object sender, ItemDragEventArgs e) { TreeNode selectNode = e.Item as TreeNode; this.tvModel.SelectedNode = selectNode; this.form.DoDrag
Time of Update: 2018-12-07
在儲存格的內容需要設定格式以便於顯示時發生。 如: 代碼 /// <summary>/// 儲存格顯示格式事件/// </summary>/// <param name="sender"></param>/// <param name="e"></param>private void dataGridView1_CellFormatting(object sender, DataGridViewCellFormatti
Time of Update: 2018-12-07
1).右鍵點擊行時選中行,並彈出操作菜單1). 添加一個捷徑功能表contextMenuStrip1;2). 給dataGridView1的CellMouseDown事件添加處理常式: private void dataGridView1_CellMouseDown(object sender, DataGridViewCellMouseEventArgs e) { if (e.Button == MouseButtons.Right)
Time of Update: 2018-12-07
能看到那台機器,說明網路是相通的,只是不能允許訪問而已。你可以試著這樣解決:1.開啟guest使用者,具體操作:我的電腦右擊---管理---本機使用者和組--開啟guest使用者。2.在運行裡輸入gpedit.msc,會彈出組策略對話方塊,電腦配置---windows設定---安全設定---本地策略----使用者權利指派---找到從網路訪問此電腦,添加guest使用者;找到拒絕從網路訪問電腦,刪除guest使用者。再找到安全選項,找到“賬戶:使用空白密碼的本地賬戶”安全設定給為已停用。 一般
Time of Update: 2018-12-07
(1)、子表單toolstrip合并到主表單toolstrip使用:http://www.mzwu.com/article.asp?id=2840
Time of Update: 2018-12-07
一、winform TreeView控制項的實現方式。 /// <summary> /// Handles the MouseMove event of the treeView1 control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e"&
Time of Update: 2018-12-07
本文轉自:http://hi.baidu.com/plj_/blog/item/6efe90a37053d2a7cbefd099.html #region 匯出Execl private void sBtnExportToXLS_Click(object sender, EventArgs e) { string fileName = ShowSaveFileDialog("Microsoft Excel Document",
Time of Update: 2018-12-07
如果Main視窗為MDI視窗,只需要設定屬性IsMdiContainer為Ture;彈出來的表單添加如下代碼就可以讓子視窗在父表單中嵌套彈出。 private void ShowForm1_Cick(object sender, EventArgs e) { Form1 childForm = new Form1(); childForm.MdiParent = this; childForm.Show
Time of Update: 2018-12-07
最近在項目中使用到了DX中的TreeList控制項綁定資料來源時在每個節點前顯示特點的圖片;查閱相關資料實現方法如下:1.首先開啟VS2010建立一個WINFROM應用程式;2.在WINFROM應用程式中增加DX中的TreeList控制項;如:3.在表單載入時進行TreeList控制項的資料來源綁定; private void Form1_Load(object sender, EventArgs e) { DataTable dt =