Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding a Procedure to Multiple Objects

Status
Not open for further replies.

Steve Meyerson

Programmer
Sep 17, 2020
317
1
18
US
Is there a way I could add a procedure to multiple textboxes (24 in this case) programatically?

The textboxes are already created, but now need a Valid event.

I know I can easily add the Valid event's procedure individually for each textbox, but I'm looking for a programming shortcut. It's a lazy solution in this case, but there could be more objects in the future.

Thanks for any help.

Steve
 
Here, by the way, how all individual visual grid features are turned off:

gridfeatures_cwqqid.png


You can do all of this or just part of it to remove what annoys you.

If you then set all columns sparse = .F. and insert controls into the columns, you can use the grid as a "control repeater", one set of controls for a record is repeatedly drawn, in the height distance of Grid.RowHeight. And the controls on one row are spaced according to column widths and you can have left/center right alignment with the Column.Alignment property.

You can really control which features of the grid show or don't show.

The only fine lines that are not removable are the border lines of the whole grid, but you can use a container without border lines, make its width 2 pixels lower than the grid width make its height two pixeels lower than the grid height and put the grid inside this container. Now position it at top=left=-1 and you also don't see the grid border.

That's how you can make the grid act as a control repeater. You get as many lines as the recordsource has records (limited by the grid height, of course. You can also define one set of controls you want to display in a container and only use one column of the grid, set its currentcontrol to this container and that is repeated. That even allows a record control structure that has 2 or 3 lines, just set the RowHeight high enough and the column1 width, so the container shows fully.

Chriss
 
Thanks, Chris!

Mike,
Just to let you know, I broke the "If-it-ain't-broke-don't-fix-it" rule and used used your clear & precise step-by-step to create classes (2 textboxes). Still works great. [dazed] Thanks.
Steve
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top