>I'm seeing a couple of possibilities here. Try not using formset but rather form. I have found it much easier to design a class visually and create custom properties and methods.
Seems to be that createobject()ing of a formset is a great PITA, if you want it to do anything that isn't defined in its class. I think I'll just copy the class definition and save it without formset. Though, I'll have to move all the things from the formset into the form, but then, hey, it's OOP - have to do that only once.
> You can then put in main, PUBLIC oSomeFormName = " ".
>Then when you launch the form in .prg:
>
>do form SomeFormName name oSomeFormName linked with whatever, whatever
This wouldn't be suitable in this case - I want to keep it small and simple.
>if messagebox("what?", nWinType, cWinText) = 6
> do something
>else
> or not
>endif
MessageBox is not applicable at all in my case - its buttons are always in English (since we're a small market here, there's no localized version of neither VFP nor Windows), and, besides, the available set of choices is completely wrong for most of the occasions. How do you get a message box to display "The date ../../.. seems to be wrong" with buttons captioned "I'ts OK as is", "Let me fix it"?
Instead, I've written a decent substitute for MessageBox - it takes the buttons' captions in its second parameter, and returns 1, 2, 3.. the ordinal number of the button clicked, which seems much more logical than the MessageBox()'s constants. And it returns 0 if closebox is clicked, or ESC pressed. In the above example, I simply call:
if 1=alert("The date "+dtoc(this.value)+" seems to be wrong", "I'ts OK as is;Let me fix it")
set notify on
return .t.
else
set notify off
return .f.
endif
Anyway, this isn't about messagebox type dialogs at all - it's where I ask two dates to be entered, or a name or so - little data entry dialogs, with controls usually bound to private vars.