DisplayScrollBars 属性 (ActiveX) 
指定是否在绘图窗口的底部和右侧显示滚动条。 支持的平台:仅限 Windows 属性值只读:不 类型:布尔 
 言论此属性的初始值为 。False 例子VBA: Sub Example_DisplayScrollBars()
    ' This example returns the current setting of
    ' DisplayScrollBars. It then changes the value, and finally
    ' it resets the value back to the original setting.
    
    Dim preferences As AcadPreferences
    Dim currDisplayScrollBars As Boolean
    
    Set preferences = ThisDrawing.Application.Preferences
    
    ' Retrieve the current DisplayScrollBars value
    currDisplayScrollBars = preferences.Display.DisplayScrollBars
    MsgBox "The current value for DisplayScrollBars is " & preferences.DISPLAY.DisplayScrollBars, vbInformation, "DisplayScrollBars Example"
    
    ' Change the value for DisplayScrollBars
    preferences.DISPLAY.DisplayScrollBars = Not (currDisplayScrollBars)
    MsgBox "The new value for DisplayScrollBars is " & preferences.DISPLAY.DisplayScrollBars, vbInformation, "DisplayScrollBars Example"
    
    ' Reset DisplayScrollBars to its original value
    preferences.DISPLAY.DisplayScrollBars = currDisplayScrollBars
    MsgBox "The DisplayScrollBars value is reset to " & preferences.DISPLAY.DisplayScrollBars, vbInformation, "DisplayScrollBars Example"
End Sub
可视化 LISP: (vl-load-com)
(defun c:Example_DisplayScrollBars()
    ;; This example returns the current setting of
    ;; DisplayScrollBars. It then changes the value, and finally
    ;; it resets the value back to the original setting.
    (setq acadObj (vlax-get-acad-object))
    (setq preferences (vla-get-Preferences acadObj))
    
    ;; Get the Display preferences object
    (setq ACADPref (vla-get-Display preferences))
    ;; Retrieve the current DisplayScrollBars value
    (setq currDisplayScrollBars (vla-get-DisplayScrollBars ACADPref))
    (alert (strcat "The current value for DisplayScrollBars is " (if (= currDisplayScrollBars :vlax-true) "True" "False")))
    
    ;; Change the value for DisplayScrollBars
    (setq newValue (if (= currDisplayScrollBars :vlax-true) :vlax-false :vlax-true))
    (vla-put-DisplayScrollBars ACADPref newValue)
    (alert (strcat "The new value for DisplayScrollBars is " (if (= newValue :vlax-true) "True" "False")))
    
    ;; Reset DisplayScrollBars to its original value
    (vla-put-DisplayScrollBars ACADPref currDisplayScrollBars)
    (alert (strcat "The DisplayScrollBars value is reset to " (if (= currDisplayScrollBars :vlax-true) "True" "False")))
)
 | 
|Archiver|CAD开发者社区
( 苏ICP备2022047690号-1   苏公网安备32011402011833)
GMT+8, 2025-11-4 23:57
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.