- Katılım
- 2 Mart 2005
- Mesajlar
- 2,960
- Excel Vers. ve Dili
-
ev: Ofis 2007- Win Xp
iş: Ofis 2010- Win Vista
Frame1 üzerinde seçilen optionbuttonun captionuna göre belirtilen yoldaki resmi yükle makrosu nasıl yazılır?
ben deneme amacıyla command buton ile istediğimi başardım ama bunun otomatik olmasını istiyorum:
USERFORM
MODULE
Ancak ben Frame1 üzerinde seçilen optionbutton değiştiğinde İmage1 üzerindeki resminde değişmesini istiyorum mümkün mü?
ben deneme amacıyla command buton ile istediğimi başardım ama bunun otomatik olmasını istiyorum:
USERFORM
Kod:
Private Sub CommandButton1_Click()
Dim CtrlOpt As Control
Dim optSecim As String
[COLOR=red]'*\ Seçilen Option butonunun başlığını tespit ettik[/COLOR]
For Each CtrlOpt In Me.Frame1.Controls
If (TypeName(CtrlOpt) = "OptionButton" And CtrlOpt.Value = True) Then
optSecim = CtrlOpt.Caption
'GoTo ResumeSub:
Else
'MyMsg = "Secili yok...."
End If
Next
'ResumeSub:
[COLOR=red]'*\ve image1 e yükledik.[/COLOR]
frmRes = klsrAddIns & AppPthSept & "AddInsResim" & AppPthSept & optSecim & ".JPG" 'icon yolu
Image1.Picture = LoadPicture(frmRes)
End Sub
Kod:
Private Sub UserForm_Activate()
Call KlsrDgr
'Dim dsyIco$
'dsyIco = klsrAddIns & AppPthSept & "AddInsResim" & AppPthSept & "BitTorrentFolder1.ico" 'icon yolu
'Call UserformlardaEkOzellik(Me, , , True, True, False, True, False, False, True, True, dsyIco)
End Sub
Kod:
Sub KlsrDgr()
AppPthSept = Application.PathSeparator
klsrBlglrm = CreateObject("WScript.Shell").SpecialFolders("MyDocuments")
klsrAddIns = Environ("appdata") & AppPthSept & "Microsoft" & AppPthSept & "AddIns"
End Sub