Thread: Class Events
View Single Post
  #15   Report Post  
Posted to microsoft.public.excel.programming
Peter T Peter T is offline
external usenet poster
 
Posts: 5,600
Default Class Events

Hi Gareth,

Glad it worked and thank you for your kind comments.

A minor mod, in clsGrid2 lbl_MouseMove, could change

clsDraw.DelSelection
to
'if user holds Ctrl - extend previous selection
If Shift < 2 Then clsDraw.DelSelection

but where to stop...

I like the demo file you uploaded. As you are setting a parent class it
occurs to me could also "RaiseEvents" from the child class to back to
parent. But that's another story.

I had a slight problem running your file in IE. Couldn't save it and closing
IE left me with an invisible instance of Excel, do doubt me missing
something obvious. Any chance you could mail (see below) a zipped copy - I
might nick some of your ideas!

Regards,
Peter T
pmbthornton gmail com


"Gareth" <nah wrote in message
...
Hi Peter,

No need to feel guilty! Your code and comments were very useful and
really helped me get my head around all of this.

I really appreciate you taking the time out to tackle the problem. Your
solution is really neat - I love the way the mouse icon changes when
you select or go outside the grid. And it's compact too.

In the meantime I'd made a good start on the grid and got it behaving
pretty much as I wanted so far. I shall upgrade it later to incorporate
your suggestions.

For what it's worth I've made what I've done before seeing your new
version available at:

http://www.garhoo.com/vba/GridPlay.xls

If you fancy having a look there it will save you copying and pasting
code (I don't think there's any benefit to the NG for me to post mine
now). I wouldn't suggest for a minute you trawl through my code but if
you like you could run userform1. It finally looks like it should now -
a bit prettier now I've sized and labeled it properly although it's
still a mess. Things of note:

- Demonstrates multiple grids of differing sizes on the same form.
(No, that's not probably how I would use it in real life!! Just an
interesting exercise...)

- I've placed it in a frame now so (a) when I use it for real I can
position it on the form roughly at design time and then let it size
itself more accurately and (b) I can use it as a holder for all the
labels etc. in addition to the core grid.

- There's a few buttons to zoom in and out / expand and contract the y
axis. Just an experiment - it doesn't work that well yet. I think that's
a can of worms I might leave shut.

- You can replace a selection with a "slot" now. and then select one
of the slots. Doesn't it get exciting?

Clearly there's much to be done, it just requires a bit more work!

Once again, thanks very much for your kind help.

Gareth

< snip