最近,有用戶提出 Spread 表格控件可否根據單元格類型改變鼠標形狀。例如,當單元格類型爲 ComboBoxCellType 的時候,可否把鼠標形狀改變爲 Handle 形狀。同時,單擊下拉按鈕時顯示下拉列表。 c#
這個 Case 咱們能夠經過自定義 CellType 來實現。 ide
須要經過繼承 ComboBoxCellType ,重寫 GetReservedCursor 方法來改變鼠標形狀。 code
1: public override Cursor GetReservedCursor(object o) 2: { 3: if (o != null) 4: return Cursors.Arrow; 5: else 6: return null; 7: }
效果圖: htm
Demo 下載: blog
VS2010 + Spread Studio 7 + .NET 4 點擊下載使用控件查看地址:點擊查看 繼承