Class Object with Custom Shapes? (Polylines)

theophan

New Member
Joined
Dec 13, 2006
Messages
17
Newbie to Class Modules but I have grasped a number of examples including Charts events and the various OLEObjects and MSForms examples.

GOAL: To create a set of Objects with custom properties and methods withevents processing and draw a custom graphic (POLYLINE).

I can draw the polyline using array variables but as a shape object it can only be assigned a macro rather than process events. I hope I am missing something that the more experienced can educate me.

WORKAROUND: Appears to be use an IMAGE OleObject but I am concerned about performance since there would be 100-200 small GIF's...

any ideas would shower good Karma your way -:)

_theophan
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
WithEvents on WORKSHEET (Not a UserForm)?

I hope this question can be more specific:

Below is a Code sample that works great to initialize the Event processing with Controls on a UserForm but I am stumped as to the method to use if the controls are on the Worksheet. I have tried shape, OleObjects but no joy. My application actually uses MSForms.Label placed on a worksheet so it would be nice to have only 1 click event.

Is it possible? (Thanks for any ideas)

Option Explicit
Dim Buttons() As New Class1

Sub ShowDialog()
Dim ButtonCount As Integer
Dim ctl As Control

' Create the Button objects
ButtonCount = 0
For Each ctl In UserForm1.Controls
If TypeName(ctl) = "CommandButton" Then
If ctl.Name <> "OKButton" Then 'Skip the OKButton
ButtonCount = ButtonCount + 1
ReDim Preserve Buttons(1 To ButtonCount)
Set Buttons(ButtonCount).ButtonGroup = ctl
End If
End If
Next ctl
UserForm1.Show
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,651
Messages
6,120,738
Members
448,988
Latest member
BB_Unlv

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top