Solved

Creating a custom control and setting properties?

Posted on 2014-03-28
2
220 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
[X]
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
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

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

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…
Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …

688 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