我想把ComboBox右边的下拉条的宽度增大一些。该如何设置呢?还有我想把RichTextEdit右侧的滚动条的宽度设置的大一些。又该如何设置呢?

解决方案 »

  1.   

    1、在tcombobox类下增加一个属性DropDownWidth
    2、或者从tcombobox派生一个类,增加一个属性DropDownWidthTComboBox = class(TCustomComboBox)
    published     
      property DropDownWidth: Integer    read FDropDownWidth  write SetDropDownWidth   default 0; 
    protected         
      FDropDownWidth: Integer;         
      procedure SetDropDownWidth( Value: Integer ); virtual;
    end;procedure Tcombobox.SetDropDownWidth( Value: Integer );
    begin  
      if FDropDownWidth <> Value then  
      begin    
        FDropDownWidth := Value;    
        SendMessage( Handle, cb_SetDroppedWidth, FDropDownWidth, 0 );  
      end;
    end;