Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Command buttons on a form
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00267699
Message ID:
00267981
Views:
24
>Roi,
>I now now about the thisForm.ControlCount and thisForm.Controls[nCnt].Name
>references. So my goal is to
>1)have the commandbutton the mouse is over resized and then unsized when the mouse moves off for any/all commandbuttons on a form
>2) be able to write this as a class so as to drag into future forms.
>
>DOable?

Hi Timothy,

Sure it's doable. Did you get a chance to look at the _mouseoverfx class? I'm guessing your trying to create a custom class that you can drop on a form, at it's init it builds a list of all the command buttons on a form. It will also attempt to determine which button the mouse is over and resize that button?

I think that maybe the hard way to do it. Each button has a mousemove event and knows when the mouse is over it and what should happen at that time. Why not let the button handle it.

I would suggest subclassing the _mouseoverfx class (call it TimFx for now) and adding ResizeMe and UnSize methods to it. You can copy code from the HighlightMe and CancelHighlight methods to make the new methods. Then just drop the TimFx class on a form.
<b>In your Form base class add the following property:</b>
.lFxAvailable = .F.

<b>In the form init:</b>
if vartype(thisform.TimFx1) = 'O'
    thisform.lFxAvailable = .T.
endif

<b>In the form MouseMove:</b>
if thisform.lFxAvailable
    thisform.TimFx1.UnSize()  && Unsize any sized buttons
endif

<b>In your CommandButton base class add the following property:</b>
.lDoResizeFx = .F.

<b>Add to the MouseMove event:</b>
<pre>if thisform.lFxAvailable and this.lDoResizeFx
    thisform.TimFx1.ResizeMe(this)
endif
Now all you have to do is drop the TimFx class on a form, change the .lDoResizeFx flag to .T. on any buttons you want to have the effect and your done.

Does that sound like something that would be workable for you?
Roi
'MCP' Visual FoxPro

In Rome, there was a poem.
About a dog, who found two bone.
He lick the one, he lick the other.
He went pyscho, he drop dead!
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform