返回列表 上一主題 發帖

[發問] 表單列印

[發問] 表單列印


Personnel.PrintForm
會連同指令按鈕、清單的捲軸一起列印
請問有什麼方法可以除去指令按鈕??

回復 1# solely
  1. Private Sub CommandButton1_Click() '列印按鈕
  2. With Me
  3. For Each ct In .Controls
  4.    If ct.Name Like "CommandButton*" Then ct.Visible = False
  5. Next
  6. .PrintForm
  7. For Each ct In .Controls
  8.    If ct.Name Like "CommandButton*" Then ct.Visible = True
  9. Next
  10. End With
  11. End Sub
複製代碼
學海無涯_不恥下問

TOP

回復 2# Hsieh
謝謝版主~
依樣畫葫蘆我把這句
If ct.Name Like "CommandButton*" Then ct.Visible = False
改成
If ct.Name Like "ComboBox*" Then ct.DropButtonStyle = 0
也可以把ComboBox的小箭頭消掉XD
所以說...我幫指令按鈕、清單取名字...是多此一舉-.-""..只會增加寫程式的困擾~

TOP

若取成有規則性的名字就會有好處
學海無涯_不恥下問

TOP

規則性??
像CB_add
   CB_search
   CB_print
這樣子嗎??

TOP

        靜思自在 : 有心就有福,有願就有力,自造福田,自得福緣。
返回列表 上一主題