473,387 Members | 1,757 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,387 software developers and data experts.

User Control

Hi All,

I'm looking for a good example for writing a User Control that does not
expose the properties of the User Control itself (ie. Tab Stop, Password,
Colors, etc.). I only want to expose the Properties and Methods I created.
Also, I would like to make it invisible at runtime (this.visible = true;
works fine). One last thing is how can I make it go to the bar where all
other non runtime controls (ie. Timer, Menus, Statusbar, etc.) instead of
having it on the application form?

Thanks in advance,
Greg O.
Nov 16 '05 #1
4 5077
Hi Greg,

I would suggest to go with writing a component yourself. According to your
post the component you want to write is not a control on its own.
Unfortunately I dare to say that there is not enough information about how
to write designers. The best article I have found so far is
http://windowsforms.net/articles/shapedesigner.aspx

however check this site you there is more articles that might help you
http://www.windowsforms.net/Articles...131&tabindex=3
--
HTH
Stoitcho Goutsev (100) [C# MVP]
"Greg Oetker" <go*****@webmailbox.net> wrote in message
news:PH***************@newssvr23.news.prodigy.com. ..
Hi All,

I'm looking for a good example for writing a User Control that does not
expose the properties of the User Control itself (ie. Tab Stop, Password,
Colors, etc.). I only want to expose the Properties and Methods I created.
Also, I would like to make it invisible at runtime (this.visible = true;
works fine). One last thing is how can I make it go to the bar where all
other non runtime controls (ie. Timer, Menus, Statusbar, etc.) instead of
having it on the application form?

Thanks in advance,
Greg O.

Nov 16 '05 #2
Thanks for the input. That looks like where I need to go to find the
answers.

Greg O.

"Stoitcho Goutsev (100) [C# MVP]" <10*@100.com> wrote in message
news:%2***************@TK2MSFTNGP10.phx.gbl...
Hi Greg,

I would suggest to go with writing a component yourself. According to your
post the component you want to write is not a control on its own.
Unfortunately I dare to say that there is not enough information about how
to write designers. The best article I have found so far is
http://windowsforms.net/articles/shapedesigner.aspx

however check this site you there is more articles that might help you
http://www.windowsforms.net/Articles...131&tabindex=3

--
HTH
Stoitcho Goutsev (100) [C# MVP]
"Greg Oetker" <go*****@webmailbox.net> wrote in message
news:PH***************@newssvr23.news.prodigy.com. ..
Hi All,

I'm looking for a good example for writing a User Control that does not
expose the properties of the User Control itself (ie. Tab Stop, Password, Colors, etc.). I only want to expose the Properties and Methods I created. Also, I would like to make it invisible at runtime (this.visible = true;
works fine). One last thing is how can I make it go to the bar where all
other non runtime controls (ie. Timer, Menus, Statusbar, etc.) instead of having it on the application form?

Thanks in advance,
Greg O.


Nov 16 '05 #3
The ultimate answer I was looking for was as follows;

public class MyClass: System.ComponentModel.Component
By using System.ComponentModel.Component that gives be the lowest base of a
control before it starts inheriting properties and methods from the parent
control.

System.Object
System.MarshalByRefObject
System.ComponentModel.Component
System.Windows.Forms.Control
System.Windows.Forms.ScrollableControl
System.Windows.Forms.ContainerControl
System.Windows.Forms.UserControl


"Greg Oetker" <go*****@webmailbox.net> wrote in message
news:V4*****************@newssvr23.news.prodigy.co m...
Thanks for the input. That looks like where I need to go to find the
answers.

Greg O.

"Stoitcho Goutsev (100) [C# MVP]" <10*@100.com> wrote in message
news:%2***************@TK2MSFTNGP10.phx.gbl...
Hi Greg,

I would suggest to go with writing a component yourself. According to your
post the component you want to write is not a control on its own.
Unfortunately I dare to say that there is not enough information about how to write designers. The best article I have found so far is
http://windowsforms.net/articles/shapedesigner.aspx

however check this site you there is more articles that might help you

http://www.windowsforms.net/Articles...131&tabindex=3


--
HTH
Stoitcho Goutsev (100) [C# MVP]
"Greg Oetker" <go*****@webmailbox.net> wrote in message
news:PH***************@newssvr23.news.prodigy.com. ..
Hi All,

I'm looking for a good example for writing a User Control that does not expose the properties of the User Control itself (ie. Tab Stop,

Password, Colors, etc.). I only want to expose the Properties and Methods I created. Also, I would like to make it invisible at runtime (this.visible = true; works fine). One last thing is how can I make it go to the bar where all other non runtime controls (ie. Timer, Menus, Statusbar, etc.) instead of having it on the application form?

Thanks in advance,
Greg O.



Nov 16 '05 #4
Hi Greg,

To prevent a property to be displayed, use this attribute.

[Browsable(false)]

It will work.

Correct me if i am wrong.
--
Regards,
Chua Wen Ching :)
"Greg Oetker" wrote:
The ultimate answer I was looking for was as follows;

public class MyClass: System.ComponentModel.Component
By using System.ComponentModel.Component that gives be the lowest base of a
control before it starts inheriting properties and methods from the parent
control.

System.Object
System.MarshalByRefObject
System.ComponentModel.Component
System.Windows.Forms.Control
System.Windows.Forms.ScrollableControl
System.Windows.Forms.ContainerControl
System.Windows.Forms.UserControl


"Greg Oetker" <go*****@webmailbox.net> wrote in message
news:V4*****************@newssvr23.news.prodigy.co m...
Thanks for the input. That looks like where I need to go to find the
answers.

Greg O.

"Stoitcho Goutsev (100) [C# MVP]" <10*@100.com> wrote in message
news:%2***************@TK2MSFTNGP10.phx.gbl...
Hi Greg,

I would suggest to go with writing a component yourself. According to your post the component you want to write is not a control on its own.
Unfortunately I dare to say that there is not enough information about how to write designers. The best article I have found so far is
http://windowsforms.net/articles/shapedesigner.aspx

however check this site you there is more articles that might help you

http://www.windowsforms.net/Articles...131&tabindex=3


--
HTH
Stoitcho Goutsev (100) [C# MVP]
"Greg Oetker" <go*****@webmailbox.net> wrote in message
news:PH***************@newssvr23.news.prodigy.com. ..
> Hi All,
>
> I'm looking for a good example for writing a User Control that does not > expose the properties of the User Control itself (ie. Tab Stop,

Password,
> Colors, etc.). I only want to expose the Properties and Methods I

created.
> Also, I would like to make it invisible at runtime (this.visible = true; > works fine). One last thing is how can I make it go to the bar where all > other non runtime controls (ie. Timer, Menus, Statusbar, etc.) instead

of
> having it on the application form?
>
> Thanks in advance,
> Greg O.
>
>



Nov 16 '05 #5

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

Similar topics

6
by: martin | last post by:
Hi, I am a web page and a web user control. My web user control is placed in my web page using the following directive <%@ Register TagPrefix="uc1" TagName="Header"...
1
by: Shourie | last post by:
I've noticed that none of the child controls events are firing for the first time from the dynamic user control. Here is the event cycle. 1) MainPage_load 2) User control1_Load user clicks a...
6
by: Steve Booth | last post by:
I have a web form with a button and a placeholder, the button adds a user control to the placeholder (and removes any existing controls). The user control contains a single button. I have done all...
4
by: louise raisbeck | last post by:
Resending this as own topic as didnt get answer from original. Would be grateful for a response from anyone that knows. Thanks. Hi there, I found your post really helpful..but i wondered if, once...
0
by: tony | last post by:
Hello! This is a rather long mail but it's a very interesting one. I hope you read it. I have tried several times to get an answer to this mail but I have not get any answer saying something...
8
by: fernandezr | last post by:
I would like to use a user control as a template inside a repeater. Some of the fields in the control should be hidden depending on whether or not there is data. I'm still a ASP .Net newbie so the...
0
by: davidr | last post by:
Hi, I have a panel that I load user Control in no problem. The problem arrises when I do a post back on one of these user controls. I have button it does a click event. In this click event I...
2
by: rn5a | last post by:
Assume that a user control (MyUC.ascx) encapsulates 2 TextBoxes with the IDs 'txt1' & 'txt2' respectively. To use this user control in an ASPX page, the following Register directive will be...
2
by: ChrisCicc | last post by:
Hi All, I got a real doozy here. I have read hundreds upon hundreds of forum posts and found numerous others who have replicated this problem, but have yet to find a solution. Through testing I have...
3
by: Fred Chateau | last post by:
I am trying to access a user control class, for a user control that is loaded dynamically, from the containing page. I have been able to access Web controls in the user control, but so far I have...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...

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.