I just found some code snippets on google to create propreties for a UserControl. The problem is they won't save when I modify them in the proprieties in the IDE... I'm new to ActiveX etc, so can you please be clear? I could also upload the entire project, because I really want this to be fixed... Thanks for reading!
Thanks for the welcome!!! However, when I put them I don't get errors, but when I set the property and then run the program the setting becomes blank...
Most of the "load errors" in the IDE are bcause you did not include the .ctx files for the 2 UserControls.
There is also a funky reference path to your modPete.bas module in the .vbp file that needs cleaning up. Open it with NotePad to fix it.
You are missing event handlers in the UserControls for the Readproperties() and WriteProperties() UserControl events. This is how design-time settings get stored and loaded.
Man, please try a little whitespace in your code. A blank line between Functions and Subs goes a long way, and indenting to show the scope of code helps a whole lot.
Option Explicit is your friend. You should have the IDE option set to automatically add this line whenever you create a module:
Menu: Tools|Options...
Editor tab: check "Require Variable Declaration."
See the VB6 documentation for details on creating a UserControl. Be careful with stuff you find on the Internet. There is a lot of lousy example code out there!
Hopefully you have the CDs that came with VB6. Microsoft has pulled a lot of the VB6 documentation off their web sites.
Private Sub UserControl_ReadProperties(PropBag As PropertyBag)
End Sub
Private Sub UserControl_WriteProperties(PropBag As PropertyBag)
End Sub
i.e you have to write all you properties to PropBag in WriteProperties event of your control and you have to use ReadProperties Event to read back all properties from PropBag.
PropBag is used to save the properties of controls.