在delphi中制作了一個ocx, 在另一個Delphi程式中呼叫,沒有一點問題,能正常顯示選中狀態 (控制元件原型是TDrawGrid):

代碼:

OCX制作時的關鍵代碼如下:

注: 實作已添加有屬性SelectionRect: property SelectionRect: OleVariant read Get_SelectionRect write Set_SelectionRect;
以上是在Delphi里開發ocx,又在delphi里使用這個ocx,都沒有問題。ok, 問題來了,到了C#中呼叫,卻出錯:

是型別使用不對嗎?
uj5u.com熱心網友回復:
補充一下,delphi中 TGridRect在Grids單元中的宣告是這樣的:TGridRect = record
case Integer of
0: (Left, Top, Right, Bottom: Longint);
1: (TopLeft, BottomRight: TGridCoord);
end;
uj5u.com熱心網友回復:
我看到有文章說要把struct轉換為byte[]傳遞轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/37861.html
標籤:VCL組件開發及應用
