Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Creating a custom control and setting properties?

Posted on 2014-03-28
2
218 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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Error message when using PrintSocket.Send 7 18
Visual studio 2015 1 21
Code enhancement 4 20
vb.net convert long time to mm:ss 23 11
If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

840 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