473,387 Members | 1,483 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.

common panel on 2 forms

NM
Hi,

In my project, I have 2 forms; both have a common panel (with combobox,
textbox, labels, methods, ...).
Is it possible to create that compoment separetly and then add it to the 2
forms?
If yes, how?

Thanks in advance;
Nov 20 '05 #1
11 1576
NM,

Just create your own inherited panel from that.

To di ut us just Add new> item> user control and than change in the code of
that the toprow "usercontrol" for the control you want to inherit in this
case panel. and go on. It is very easy to do when you know how.

I hope this helps?

Cor

Hi,

In my project, I have 2 forms; both have a common panel (with combobox,
textbox, labels, methods, ...).
Is it possible to create that compoment separetly and then add it to the 2
forms?
If yes, how?

Thanks in advance;

Nov 20 '05 #2
* "NM" <NM****@hotmail.com> scripsit:
In my project, I have 2 forms; both have a common panel (with combobox,
textbox, labels, methods, ...).
Is it possible to create that compoment separetly and then add it to the 2
forms?


"Project" -> "Add UserConntrol...".

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #3
NM
Thanks Cor,

But the common panel isn't at the same position on the 2 forms and haven't
the same size on both of them;
So my forms can't inherit the panel;

"Cor Ligthert" <no**********@planet.nl> a écrit dans le message de
news:%2****************@TK2MSFTNGP11.phx.gbl...
NM,

Just create your own inherited panel from that.

To di ut us just Add new> item> user control and than change in the code of that the toprow "usercontrol" for the control you want to inherit in this
case panel. and go on. It is very easy to do when you know how.

I hope this helps?

Cor

Hi,

In my project, I have 2 forms; both have a common panel (with combobox,
textbox, labels, methods, ...).
Is it possible to create that compoment separetly and then add it to the 2 forms?
If yes, how?

Thanks in advance;


Nov 20 '05 #4
NM
The problem with the UserControl is that I have created it with one
constructor that take an object on parameter.
I get an error with VS when I was trying to use it.
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> a écrit dans le
message de news:2n************@uni-berlin.de...
* "NM" <NM****@hotmail.com> scripsit:
In my project, I have 2 forms; both have a common panel (with combobox,
textbox, labels, methods, ...).
Is it possible to create that compoment separetly and then add it to the 2 forms?


"Project" -> "Add UserConntrol...".

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>

Nov 20 '05 #5
* "NM" <NM****@hotmail.com> scripsit:
The problem with the UserControl is that I have created it with one
constructor that take an object on parameter.
I get an error with VS when I was trying to use it.


Then use a property instead of passing the value to the ctor, for
example.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #6
NM
I need to pass the value by reference and that's not possible with property;
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> a écrit dans le
message de news:2n************@uni-berlin.de...
* "NM" <NM****@hotmail.com> scripsit:
The problem with the UserControl is that I have created it with one
constructor that take an object on parameter.
I get an error with VS when I was trying to use it.


Then use a property instead of passing the value to the ctor, for
example.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>

Nov 20 '05 #7
"NM" <NM****@hotmail.com> wrote in message
news:u4*************@tk2msftngp13.phx.gbl...
I need to pass the value by reference and that's not possible with property;


Most values are actually "by reference", depending on your definition. What
is the type of your value?

Best Regards,

Andy
Nov 20 '05 #8
NM
It's a class that I create.
I tried to modify byval by byref in the set property definition, and VS
generate an error
"Andy Becker" <x@x.com> a écrit dans le message de
news:eL**************@TK2MSFTNGP11.phx.gbl...
"NM" <NM****@hotmail.com> wrote in message
news:u4*************@tk2msftngp13.phx.gbl...
I need to pass the value by reference and that's not possible with property;


Most values are actually "by reference", depending on your definition.

What is the type of your value?

Best Regards,

Andy

Nov 20 '05 #9
"NM" <NM****@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
It's a class that I create.
I tried to modify byval by byref in the set property definition, and VS
generate an error


Let me back up then. How do you know you need to change to ByRef - what is
it you are not able to do using ByVal?

Best Regards,

Andy
Nov 20 '05 #10
NM
It's a class that I create.
I tried to modify byval by byref in the set property definition, and VS
generate an error

Let me back up then. How do you know you need to change to ByRef ? Because I need to modify some object's attributes;
- what is it you are not able to do using ByVal? The question is not what I'm not able to do using Byval;
It's : what I don't want to do if I use Byval?
And the answer is :
1) save memory (1 object instead of 2)
2) no need to update the original object by the copy after modifications


Best Regards,

Andy


Thanks to all and best regards;
Nov 21 '05 #11
"NM" <NM****@hotmail.com> wrote in message
news:O8*************@TK2MSFTNGP12.phx.gbl...
It's a class that I create.
I tried to modify byval by byref in the set property definition, and VS generate an error


Let me back up then. How do you know you need to change to ByRef ?

Because I need to modify some object's attributes;


I finally located the discussion I have been looking to send you. Your
object is not a "value type", and effectively treated the same regardless of
ByVal or ByRef.

http://msdn.microsoft.com/library/de...gmechanism.asp

Best Regards,

Andy
Nov 21 '05 #12

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

Similar topics

1
by: Robert Skidmore | last post by:
I am building an application that will fade one panel to another panel. Both panels will have picture boxes in them (thumbnails). This is what I have tried: private void...
2
by: Millennium Falcon | last post by:
Hi! In my application, I have a panel in the middle of the form, which I'll be using as a drawing panel. I would like to update the drawing panel each time when it is required, without updating...
13
by: Martin Ho | last post by:
I know this must be trivial for many of you. But I am playing with this and can't figure it out. I have a form, on that form is one panel which has 3 textboxes, when I run my program and...
6
by: QT | last post by:
Dear sirs, I want to create panel or label field for each database records. I am using following codes for each database row to create panel field. 'Panel ' i = 1
4
by: Aaron Smith | last post by:
I have a panel that I have in the paint event to draw a Raised 3d border around it.. The problem is, if a msgbox is popped up or a tooltip is displayed, it leaves lines on the panel. I've tried...
5
by: Rob T | last post by:
To keep my example simple, let's say I have a windows application form with a panel in it. For this example, I want to draw a single line in the panel, which is larger than the size of the panel. ...
8
by: tranky | last post by:
i hope you can help me! It's possible create a moveable panel in vb.net? Click with mouse over it and move it everywhere!?!? It's possible? thank u!
7
by: Sharon | last post by:
I’m using the Panel control that contains a PictureBox control (for implementing the http://www.codeproject.com/cs/miscctrl/PictureBox.asp). The Panel is set to AutoScroll = true. I wish to...
8
by: =?Utf-8?B?R3JlZyBMYXJzZW4=?= | last post by:
I'm trying to figure out how to modify a panel (panel1) from a backgroundworker thread. But can't get the panel to show the new controls added by the backgroundwork task. Here is my code. In...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: 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
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...

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.