473,583 Members | 3,425 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Displaying Controls on Multiple Forms

63 New Member
Hi all,

I have a certain number of labels that I want displayed on each of my Windows Forms in my c# Desktop Application project.

Each of the labels is used to open a relavent windows form.

Is it possible to show these labels on each form without having to create them repeatedly on each form?
Can I call them from one class? If so, how?

Thanks.
May 17 '07 #1
8 1490
Frinavale
9,735 Recognized Expert Moderator Expert
Hi all,

I have a certain number of labels that I want displayed on each of my Windows Forms in my c# Desktop Application project.

Each of the labels is used to open a relavent windows form.

Is it possible to show these labels on each form without having to create them repeatedly on each form?
Can I call them from one class? If so, how?

Thanks.

You could create a Web User Control.
You design the control just like you would any web page.
Then you can use the control on any web page.

-Frinny
May 17 '07 #2
obrienkev
63 New Member
Hi Frinny,

Its a Desktop Application so any ideas how I do it for this?

Thanks.
May 17 '07 #3
Frinavale
9,735 Recognized Expert Moderator Expert
Hi Frinny,

Its a Desktop Application so any ideas how I do it for this?

Thanks.

I'm not sure about desktop applications because I work mostly with web applications. I'm sure there's a User Control class for the desktop applications... try CustomControl.

Sorry desktop applications are unfamiliar waters to me...I've only done a few simple apps mainly created to help me test my web apps.

-Frinny
May 17 '07 #4
obrienkev
63 New Member
yup can use a UserControl.cs class.

How do I use this in each form?

Thanks.
May 17 '07 #5
Frinavale
9,735 Recognized Expert Moderator Expert
yup can use a UserControl.cs class.

How do I use this in each form?

Thanks.

Design the control the way you like it.
Add public properties to it if you need to be able to access any data within these controls in your forms.

Drag the control onto your form......name it...use it :)

Its like an object only it has a graphical aspect to it to.

-Frinny
May 17 '07 #6
obrienkev
63 New Member
thanks. works fine but when it opens a new form it disappears off the original form.

Any ideas why?

thanks again.
May 17 '07 #7
obrienkev
63 New Member
Just realised I have this line to hide the original form in the usercontrol class...

this.Hide();

How do I use the above code to hide the relevant form based on which form has been used to perform the code?

thanks.
May 17 '07 #8
Frinavale
9,735 Recognized Expert Moderator Expert
thanks. works fine but when it opens a new form it disappears off the original form.

Any ideas why?

thanks again.

I don't understand what is happening.

Do I understand this correctly:
You have a form with the user control on it and can view it perfectly.
You open another form and the user control disappears of the first form??


Just realised I have this line to hide the original form in the usercontrol class...

this.Hide();

How do I use the above code to hide the relevant form based on which form has been used to perform the code?

thanks.
I've never used this sort of thing but I would assume that the Hide() property can be used by the from that owns the control to set its visibility state. Much like the Visible() property in a Web User Control.

-Frinny
May 17 '07 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

7
3508
by: Bil Muh | last post by:
Esteemede Developers, I would like to Thank All of You in advance for your sincere guidances. I am developing a software using Visual C++ .NET Standard Edition with Windows Form (.NET) template. Briefly -------------------------------------------------------------------------------------------- I need to create dynamically some...
2
1929
by: Debster | last post by:
I am having a hard time trying to figure out why my code is not working properly. I step through the code and check the values when adding the data to the table, but my Refresh or Requery is not displaying on the subform. Any suggestions? Thanks for your help!!!!!!!!!! ********************** Code ************************************* ...
9
2329
by: Susan Bricker | last post by:
Greetings. I am having trouble populating text data that represents data in my table. Here's the setup: There is a People Table (name, address, phone, ...) peopleID = autonumber key There is a Judge Table (information about judges) judgeID = autonumber key
0
1805
by: Stuart Norris | last post by:
Dear Group, I am attempting to write a "splash" and "status" Form using a second thread. I wish to use this Form to display status information to the user when I do CPU intensive work in my GUI during startup. I wish to also use the same Form after startup as well if I do something CPU intensive. I have developed a multi-threaded...
14
5561
by: hamil | last post by:
I am trying to display an image in a picture box. The image is a group 4 fax black and white image of a piece of sheet music. The original resolution is 300 X 300 dpi. I want to have the picture box as large as possible so I can view the scanned image on my computer screen. At run time, I want to be able to view different files by changing...
7
3374
by: Terry | last post by:
I have a Mainform with a Statusbar. When opening another form or doing some processing I want to display info in the Statusbar of the Mainform. I have read a lot of articles on this & have come up with the code below. It seems to work(!!!) in that when coding the second form I can see the DisplayStatusMsg of the main form. During debug the...
2
1256
by: moumita | last post by:
I have the folowing code..the logic according to me is correct..but I dont know...the msg boxes are not displaying anything...am I supposed to change any settings ??? Public Class Form1
0
1473
by: Marcus Kwok | last post by:
I have written a class (Windows Form) in Managed C++ that accepts an array of image filenames and will display them sequentially. All images will be the same size. I got it to work, but I know something is not right because of the way I am using Application::DoEvents() (ref: http://www.codinghorror.com/blog/archives/000159.html and...
8
3568
by: Ryan | last post by:
Ok.. I have a form with lots of stuff on it; a tool strip panel, menu strip, data binding elements (dataset, binding source, table adapter), tab control with 7 tab pages, each page contains a picture box, lots of text boxes (for input).. you get the idea. All of a sudden everything on the form has disappeared, it looks like a blank, newly...
1
10894
by: blueheelers | last post by:
I have been researching for several hours on the best way to display images in continous forms in Access 2003. For example, I want to display employee name, email, phone, and picture for each record in the recordset. I can have the pictures converted to any usable format, use OLE or linking, whatever needs to be done. So far, the 3...
0
7893
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7821
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8172
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8317
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7928
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
1
5695
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5369
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3813
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3839
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.