473,406 Members | 2,390 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Set the toolbox icon and default text for a control

Hi,

I have create an inherited control (a TextBox which doesn't accept numbers)
and have added it to my toolbox.

Can anyone give pointers on how to set the Text to "" when an instance of
this control is dropped onto a Windows form? I have set the Text to "" in
the constructor for the control but it still shows NoNumbers1, NoNumbers2,
etc.

Also, a quick reminder on how to set the toolbox icon would be appreciated.
Sep 9 '06 #1
2 1938
You set the toolbox bitmap icon with teh System.Drawing.ToolboxBitmapAttribute
and I think you need to set the System.ComponentModel.DefaultValueAttibute
for the text property to specify what to make it when a new one is made in
the designer.

HTH

Ciaran O'Donnell

"cashdeskmac" wrote:
Hi,

I have create an inherited control (a TextBox which doesn't accept numbers)
and have added it to my toolbox.

Can anyone give pointers on how to set the Text to "" when an instance of
this control is dropped onto a Windows form? I have set the Text to "" in
the constructor for the control but it still shows NoNumbers1, NoNumbers2,
etc.

Also, a quick reminder on how to set the toolbox icon would be appreciated.
Sep 9 '06 #2
Can anyone give pointers on how to set the Text to "" when an instance of
this control is dropped onto a Windows form? I have set the Text to "" in
the constructor for the control but it still shows NoNumbers1, NoNumbers2,
etc.
Provide a custom designer inherited from ControlDesigner. Specify the
initial values by overriding InitializeNewComponent method

Also, a quick reminder on how to set the toolbox icon would be
appreciated.
See Ciaran's post
/claes
Sep 11 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: steve bull | last post by:
I created a control and added to my toolbox and it worked fine including the controls icon until I decided to merge the project that contains the control into an existing project. I have included...
2
by: Showjumper | last post by:
I want my custom control to have its own toolbox icon. I create the bmp file and it has the same name as the control class. I then set it to embedded resource but it still doesnt appear in the...
1
by: Philippe Meunier | last post by:
Ok, I already asked a question similar to this one but didn't found any answer ! I've a solution with 2 projects in it. One of the project contains Usercontrols and Inherited Controls. I work...
2
by: Mamatha | last post by:
Hi I want to add an icon to the textbox's text. I don't know how to display icon in textbox in VB.NET. If any one knows please let me know. Thanks in advance. Mamatha
1
by: Just Me | last post by:
Some of my controls appear twice in my tool box. One has an icon that looks like gear. the other icon is a rectangle containing 4 squares plus a small rectangle and a blue line at the top....
3
by: the whip | last post by:
The icons next to the text description in the toolbox for all MSFT controls are the same. Right now for instance the pointer icon is beside every control(labels, buttons, etc). Which icon is...
0
by: Sagaert Johan | last post by:
Hi I noticed that the icon in the toolbox is always the default icon even when an icon has been specified. The custom icon only shows up when i add assembly to the toolbox manually. The...
4
by: Suhaib | last post by:
Hi All, I'm using VS 2005 8.0.50727.42 (RTM.050727-4200), with .NET framework 2.0. Everything was working fine, but now suddenly I don't see my ToolBox icons, whether you are in design mode or...
7
by: gtrDayve | last post by:
Recently I ran all my Windows Updates which included many for Visual Studio 2005, & now when I open VS05 (using ASP.NET, VB.NET), all my toolbox options are grayed out except for the Data options;...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.