?
Solved

Creating a custom control and setting properties?

Posted on 2014-03-28
2
Medium Priority
?
223 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 2000 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

764 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