Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How do VFP controls fake it?
Message
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01037136
Message ID:
01037524
Views:
22
>Dawa,
>
>Just for fun, take a look at this code:
>
>Placing a button on the VFP form as a new child window
>http://www.news2news.com/vfp/?example=274
>
>Not Visual FoxPro CommandButton control, but real windowed BUTTON control is created using CreateWindowEx API function and placed on FoxPro form as its child window.
>
>Until VFP9, this trick would make absolutely no sense, since FoxPro code can not catch WM_COMMAND and WM_PARENTNOTIFY messages that button control sends to its parent window.
>
>With VFP9 it's still not really practical :) but now BINDEVENT() can be used to start a procedure or method every time such windowed button is clicked on.

Anatoliy,

Thanks for the link. I tried the code. It is fun!

You're right that it is not practical when you have a native button already. However, a text box or edit box with a handle would be useful when one is trying to change the caret etc. unless VFP provides a property which allows to to specify an image for the caret.
Dawa Tsering


"Do not let any unwholesome talk come out of your mouths,
but only what is helpful for building others up according to their needs,
that it may benefit those who listen."

- Ephesians 4:29-30 NIV

Dare to Question -- Care to Answer

Time is like water in a sponge, as long as you are willing you can always squeeze some.

--Lu Xun, Father of Modern Chinese Literature

Previous
Next
Reply
Map
View

Click here to load this message in the networking platform