2
如果我嘗試使用TRibbonCombobox更改色帶樣式,則會出現訪問衝突。訪問衝突如果我嘗試使用TRibbonCombobox更改色帶樣式
然後,我修改了的Delphi色帶演示,以提供一個組合框方法來設置風格:
- 加入色帶條上的TRibbonCombobox
- 添加一個事件處理程序
這裏是事件代碼:
procedure TfrmRibbonDemo.RibbonComboBox1Change(Sender: TObject);
begin
if RibbonComboBox1.Text='Luna' then
Ribbon1.Style:=RibbonLunaStyle
else
Ribbon1.Style:=RibbonSilverStyle;
end;
當我改變風格(特別是超過一次)與TRibbonCombobox,我得到:
date/time : 2009-10-02, 11:11:29, 843ms
operating system : Windows XP Service Pack 3 build 2600
physical memory : 583/2047 MB (free/total)
free disk space : (C:) 71.72 GB
display mode : 1280x1024, 32 bit
allocated memory : 23.59 MB
executable : RibbonDemo.exe
exec. date/time : 2009-10-02 11:11
compiled with : Delphi 2009
madExcept version : 3.0k
exception class : EAccessViolation
exception message : Access violation at address 0054767C in module 'RibbonDemo.exe'. Read of address 0000005F.
main thread ($ed0):
0054767c +054 RibbonDemo.exe RibbonActnCtrls TCustomRibbonComboBox.SetBounds
00546e52 +0a2 RibbonDemo.exe RibbonActnCtrls TRibbonComboControl.SetBounds
00516f39 +0f1 RibbonDemo.exe ActnMan TCustomActionControl.CalcBounds
0051853d +005 RibbonDemo.exe ActnCtrls TCustomButtonControl.CalcBounds
00546482 +00a RibbonDemo.exe RibbonActnCtrls TRibbonComboControl.CalcBounds
00516754 +030 RibbonDemo.exe ActnMan TCustomActionControl.SetSpacing
0051a243 +01b RibbonDemo.exe ActnCtrls TCustomActionToolBar.CreateControl
00557f16 +01a RibbonDemo.exe Ribbon TCustomActionControlBar.CreateControl
0056205a +006 RibbonDemo.exe Ribbon TCustomRibbonGroup.CreateControl
0051243f +087 RibbonDemo.exe ActnMan TCustomActionBar.CreateControls
00519b35 +005 RibbonDemo.exe ActnCtrls TCustomActionDockBar.CreateControls
0051a2c6 +022 RibbonDemo.exe ActnCtrls TCustomActionToolBar.CreateControls
00557fcb +027 RibbonDemo.exe Ribbon TCustomActionControlBar.CreateControls
00562075 +005 RibbonDemo.exe Ribbon TCustomRibbonGroup.CreateControls
00514542 +05e RibbonDemo.exe ActnMan TCustomActionBar.RecreateControls
0050e081 +04d RibbonDemo.exe ActnMan TCustomActionManager.SetStyle
0055dac3 +02f RibbonDemo.exe Ribbon TCustomRibbon.SetStyle
0056720c +04c RibbonDemo.exe RibbonDemoMainForm 387 +3 TfrmRibbonDemo.RibbonComboBox1Change
如果我用絲帶欄上的按鈕樣式的變化,它工作正常。
謝謝你的幫助!
哪個版本的Delphi? 2009年還是2010年? – skamradt 2009-10-02 23:27:03
很抱歉我遲到的回覆;我不知道你的味精。 2009 – 2009-10-06 15:47:41