Microsoft Office Excel ® Kod Kılavuzu

Microsoft Office Excel® Code Guide

10 Ağustos 2008 Pazar

UserForm QueryClose




'UserForm1

'Add Tools on UserForm1: Label1, label2, Label3, ComboBox1, ComboBox2, Label4
Option Explicit
Dim Vazgeçme As Boolean
Dim Yöntemi As Long

Private Sub UserForm_Initialize()
On Error Resume Next
Me.Caption = "[PBİD®] UserForm QueryClose..."
With ComboBox1
'Cancel

.AddItem "False"
.AddItem "True"
.ListIndex = 0
End With
With ComboBox2
'CloseMode

.AddItem "0"
.AddItem "1"
.ListIndex = 0
End With
End Sub
Private Sub CommandButton1_Click()
On Error Resume Next
UnLoad Me
End Sub
Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
On Error Resume Next
CloseMode = Yöntemi
If CloseMode = 0 Then
Cancel = Vazgeçme
Else
Cancel = True
End If
End Sub
Private Sub ComboBox1_Change() 'Cancel
On Error Resume Next
Vazgeçme = ComboBox1.Value
If Vazgeçme = False And Yöntemi = 0 Then
CommandButton1.Enabled = True
Else
CommandButton1.Enabled = False
End If
End Sub
Private Sub ComboBox2_Change() 'CloseMode
On Error Resume Next
Yöntemi = ComboBox2.Value
If Vazgeçme = False And Yöntemi = 0 Then
CommandButton1.Enabled = True
Else
CommandButton1.Enabled = False
End If
End Sub

Hiç yorum yok:

Blog Arşivi

Bu gadget'ta bir hata oluştu

Bu Blogda Ara

Contributor

Contributor
Mustafa ULUSARAÇ İstanbul, TÜRKİYE
free counters
T. C. Central Bank Indicative Exchange Rates
Currency Exchange Rate Widget,Currency Converter Widget
Borsa İstanbul