I have a program, and you can edit the program's buttons.
Here is what i have.
Code:'this is on the EDITING form Option Explicit Private pvarButton As CommandButton Private Sub Clear_Click() txtname.Text = "" txtToolTip.Text = "" txttag.Text = "" End Sub Private Sub Close_Click() ButScr.ImageCheck Set pvarButton = Nothing Set pvarButton = Nothing Unload Me End Sub Private Sub Form_Load() Set pvarButton = ButScr.GetButton txtname = pvarButton.Caption txttag = pvarButton.Tag txtToolTip = pvarButton.ToolTipText PictureSel.Picture = pvarButton.Picture End Sub Private Sub Ok_Click() pvarButton.Picture = PictureSel.Picture pvarButton.Caption = txtname pvarButton.Tag = txttag pvarButton.ToolTipText = txtToolTip ButScr.ImageCheck Set pvarButton = Nothing Set pvarButton = Nothing Unload Me End Sub
BUT when i do this, and right click on the Button, nothing happends. It works if i do NOT use the INDEX, but i want to use indexing so i don't have so many controlsCode:'THIS IS WHAT I HAVE ON THE MAIN FORM Property Get GetButton() As CommandButton Set GetButton = pvarButton End Property Private Sub GamePlay_Click(Index As Integer) If Button = 2 Then Set pvarButton = GamePlay(Index) ButEditScr.Show vbModal ButEditScr.update ElseEnd If End Sub
Anyone know what i can do?
Or better way? thanks



Reply With Quote