Solved

Creating a custom control and setting properties?

Posted on 2014-03-28
2
217 Views
Last Modified: 2014-04-01
I was wondering what setting, if it exists, that allows you to change specific properties for all the controls within a custom control. In other word if I want all the sub-controls to be bold...how do I set the custom control to reflect that?

Thanks!
0
Comment
Question by:BlakeMcKenna
2 Comments
 
LVL 40

Accepted Solution

by:
Jacques Bourgeois (James Burger) earned 500 total points
ID: 39963292
If by custom control you mean a UserControl, then the following explain how to do it.

For some properties, such as the Font, if you set the UserControl Font in design, the controls you put on it will have the same font by default. You can also change the property in the code, and all controls that have the default Font will follow the change.

For other properties, you will have to loop through the controls with code such as the following:

            For Each ctl As Control In Me.Controls
                  ctl.Text = "New Text"
            Next
0
 

Author Closing Comment

by:BlakeMcKenna
ID: 39969204
Thanks James...that's what I needed!
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question