473,378 Members | 1,605 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,378 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 5076
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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...

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.