PC Review


Reply
Thread Tools Rate Thread

common panel on 2 forms

 
 
NM
Guest
Posts: n/a
 
      4th Aug 2004
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;


 
Reply With Quote
 
 
 
 
Cor Ligthert
Guest
Posts: n/a
 
      4th Aug 2004
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;
>
>



 
Reply With Quote
 
Herfried K. Wagner [MVP]
Guest
Posts: n/a
 
      4th Aug 2004
* "NM" <(E-Mail Removed)> 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/>
 
Reply With Quote
 
NM
Guest
Posts: n/a
 
      4th Aug 2004
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" <(E-Mail Removed)> a écrit dans le message de
news:%(E-Mail Removed)...
> 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;
> >
> >

>
>



 
Reply With Quote
 
NM
Guest
Posts: n/a
 
      4th Aug 2004
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]" <hirf-spam-me-(E-Mail Removed)> a écrit dans le
message de news:(E-Mail Removed)...
> * "NM" <(E-Mail Removed)> 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/>



 
Reply With Quote
 
Herfried K. Wagner [MVP]
Guest
Posts: n/a
 
      4th Aug 2004
* "NM" <(E-Mail Removed)> 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/>
 
Reply With Quote
 
NM
Guest
Posts: n/a
 
      4th Aug 2004
I need to pass the value by reference and that's not possible with property;


"Herfried K. Wagner [MVP]" <hirf-spam-me-(E-Mail Removed)> a écrit dans le
message de news:(E-Mail Removed)...
> * "NM" <(E-Mail Removed)> 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/>



 
Reply With Quote
 
Andy Becker
Guest
Posts: n/a
 
      4th Aug 2004
"NM" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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


 
Reply With Quote
 
NM
Guest
Posts: n/a
 
      5th Aug 2004
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" <(E-Mail Removed)> a écrit dans le message de
news:(E-Mail Removed)...
> "NM" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > 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
>
>



 
Reply With Quote
 
Andy Becker
Guest
Posts: n/a
 
      5th Aug 2004
"NM" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> 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


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
cannot click show common tasks in folders under control panel Sharon Coomes Windows XP General 2 9th Feb 2008 04:43 PM
Excel should automatically make multi-panel charts with common axe =?Utf-8?B?S2F0Qg==?= Microsoft Excel Charting 1 27th Oct 2005 04:15 AM
Common tasks panel on Explorer not working =?Utf-8?B?RWR1?= Windows XP General 0 22nd Oct 2004 12:37 PM
Common tasks panel on Explorer not working =?Utf-8?B?RWR1?= Windows XP General 0 22nd Oct 2004 12:35 PM
Email From Forms with asp:panel.(s) Only one panel works? Harry Microsoft ASP .NET 3 10th Nov 2003 03:13 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:45 PM.