OberonPlace.com Forums  

Go Back   OberonPlace.com Forums > Developer Forums > VBA > Corel Photo-Paint VBA

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 21-04-2004, 21:50
Michael Cervantes
Guest
 
Posts: n/a
Default Command Button at runtime

I designed a button at runtime, but I do nothing when clicked. The sub Object_Click() doesn't work.

Example.
Dim padd as Control

Private ToggleButton1_Click()

Set padd = Controls.Add("Forms.CommandButton.1", "CommandButton3", Visible)
padd.Left = 10
padd.Top = 285
padd.Width = 35
padd.Height = 24
padd.Caption = "Add"

End Sub

Here every thing is fine

The click sub should be as follow or I'm wrong.

Private Sub padd_Click()
msgbox "this click is OK"
End Sub

Thanks for your time and attention.

Michael Cervantes
Reply With Quote
  #2  
Old 21-04-2004, 22:54
Alex's Avatar
Alex Alex is offline
Administrator
 
Join Date: Nov 2002
Posts: 1,940
Blog Entries: 4
Default Re: Command Button at runtime

Michael,

Maybe you should declare it as

Code:
Dim WithEvents padd As Control
Haven't tried it myself but could be worth a try...
Reply With Quote
  #3  
Old 21-04-2004, 23:37
Michael Cervantes
Guest
 
Posts: n/a
Default Command Button at runtime

Nope. It didn't work.

Message:

Run-Time Error 459

Object or class does support the set of events.

Thanks.
Reply With Quote
  #4  
Old 22-04-2004, 00:59
Michael Cervantes
Guest
 
Posts: n/a
Default Command Button at runtime

Ok. I make it works with your help of course.

Dim WithEvents padd as CommandButton

Thanks a lot.

Best regards
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Runtime error click101 Calendar Wizard 11 24-05-2012 13:21
runtime error 445 with CorelScriptTools.GetFolder() rsinnig Corel Photo-Paint VBA 1 16-10-2003 05:07


All times are GMT -5. The time now is 14:43.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.
Copyright © 2011, Oberonplace.com