473,405 Members | 2,279 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,405 software developers and data experts.

[URGENT] VB.NET : TabControl, TabPages and UserControl Communication

Hi,

I'm beginner with VB.net and i have a trouble... At work, they decided
to program with tabcontrol...and i'mm in charge of this !

There is my problem.
I've a form with one tabcontrol (TBC1 ). This TBC1 contents n TabPages
( TBP1,2,3,..,n)
For each TBPn i 've got an specific usercontrol which have controls
and code ( data access, ... ).
I want to establish dialog between the different TBP starting from any
usercontrol.

For example :

TBP1 = UserControl1 (UC1) with ComboBox and CommandButton
TBP2 = UserControl2 (UC2) with textBox, checkBox, ComboBox and
CommandButton

When I choose an item in the ComboBox of UC1, i Click on CommandButton
to fill controls of UC2.
Finally i want to show TBP2.

I hope it was clear, cos' i'm not speaking english very well, but i
understand quiet well!
Briefly my question is :
How can two USercontrols of different tabpages communicate ?

Thnks for your answers

Best Regards From Paris

Mail_taf
Nov 21 '05 #1
8 4123
You can use property's,

for example at uc1 (user control1) you can have a property and a variable:

Private strCode
Public Property code()
Get
return strCode 'can also be textbox.text or whatever you want, but I'd
advice to return 'variables
End Get
Set(ByVal Value)
strCode = value
End Set
End Property

and at uc2 you also have a property named code

Private strCode
Public Property code()
Get
return strCode
End Get
Set(ByVal Value)
strCode = value
End Set
End Property

than on the form where the user controls are on you can do:

uc2.code = uc1.code
hth

Peter

"ChrisK" <ma******@yahoo.fr> wrote in message
news:a1**************************@posting.google.c om...
Hi,

I'm beginner with VB.net and i have a trouble... At work, they decided
to program with tabcontrol...and i'mm in charge of this !

There is my problem.
I've a form with one tabcontrol (TBC1 ). This TBC1 contents n TabPages
( TBP1,2,3,..,n)
For each TBPn i 've got an specific usercontrol which have controls
and code ( data access, ... ).
I want to establish dialog between the different TBP starting from any
usercontrol.

For example :

TBP1 = UserControl1 (UC1) with ComboBox and CommandButton
TBP2 = UserControl2 (UC2) with textBox, checkBox, ComboBox and
CommandButton

When I choose an item in the ComboBox of UC1, i Click on CommandButton
to fill controls of UC2.
Finally i want to show TBP2.

I hope it was clear, cos' i'm not speaking english very well, but i
understand quiet well!
Briefly my question is :
How can two USercontrols of different tabpages communicate ?

Thnks for your answers

Best Regards From Paris

Mail_taf

Nov 21 '05 #2
Hi Chris,

I thought that I answered this as well in the general group.

You place normally your usercontrols globaly (friend) on your form,
therefore they can "talk" to each other everywhere in that class.

Therefore the only thing in my opinion that you have to do is as I as well
said in the general newsgroup is to select the right tabpage. indexof which
is a number from 0 to your last page or the tabcontrol.

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

However the question seems something else so where do I not understand you?

Cor

"ChrisK" <ma******@yahoo.fr>
..
Hi,

I'm beginner with VB.net and i have a trouble... At work, they decided
to program with tabcontrol...and i'mm in charge of this !

There is my problem.
I've a form with one tabcontrol (TBC1 ). This TBC1 contents n TabPages
( TBP1,2,3,..,n)
For each TBPn i 've got an specific usercontrol which have controls
and code ( data access, ... ).
I want to establish dialog between the different TBP starting from any
usercontrol.

For example :

TBP1 = UserControl1 (UC1) with ComboBox and CommandButton
TBP2 = UserControl2 (UC2) with textBox, checkBox, ComboBox and
CommandButton

When I choose an item in the ComboBox of UC1, i Click on CommandButton
to fill controls of UC2.
Finally i want to show TBP2.

I hope it was clear, cos' i'm not speaking english very well, but i
understand quiet well!
Briefly my question is :
How can two USercontrols of different tabpages communicate ?

Thnks for your answers

Best Regards From Paris

Mail_taf

Nov 21 '05 #3
"Cor Ligthert" <no************@planet.nl> schrieb:
I thought that I answered this as well in the general group.

You place normally your usercontrols globaly (friend) on your form,
therefore they can "talk" to each other everywhere in that class.


The fact that the instances can talk to each other doesn't have much to do
with their modifier. I suggest to set the usercontrol's modifier to
'Protected' (or 'Private'). Notice that this still won't prevent the
usercontrols from communicating.

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

Nov 21 '05 #4
Hi Cor,

I think he just want's to get some values from one usercontrol to an other
usercontrol

Peter

"Cor Ligthert" <no************@planet.nl> wrote in message
news:uD**************@TK2MSFTNGP09.phx.gbl...
Hi Chris,

I thought that I answered this as well in the general group.

You place normally your usercontrols globaly (friend) on your form,
therefore they can "talk" to each other everywhere in that class.

Therefore the only thing in my opinion that you have to do is as I as well
said in the general newsgroup is to select the right tabpage. indexof which is a number from 0 to your last page or the tabcontrol.

http://msdn.microsoft.com/library/de...us/cpref/html/
frlrfsystemwindowsformstabcontrolclassselectedtabt opic.asp
However the question seems something else so where do I not understand you?
Cor

"ChrisK" <ma******@yahoo.fr>
.
Hi,

I'm beginner with VB.net and i have a trouble... At work, they decided
to program with tabcontrol...and i'mm in charge of this !

There is my problem.
I've a form with one tabcontrol (TBC1 ). This TBC1 contents n TabPages
( TBP1,2,3,..,n)
For each TBPn i 've got an specific usercontrol which have controls
and code ( data access, ... ).
I want to establish dialog between the different TBP starting from any
usercontrol.

For example :

TBP1 = UserControl1 (UC1) with ComboBox and CommandButton
TBP2 = UserControl2 (UC2) with textBox, checkBox, ComboBox and
CommandButton

When I choose an item in the ComboBox of UC1, i Click on CommandButton
to fill controls of UC2.
Finally i want to show TBP2.

I hope it was clear, cos' i'm not speaking english very well, but i
understand quiet well!
Briefly my question is :
How can two USercontrols of different tabpages communicate ?

Thnks for your answers

Best Regards From Paris

Mail_taf


Nov 21 '05 #5
Herfried,

I can be wrong, however I thought that when you drag them on your form they
are automaticly set to Friend, that was what I tried to tell.

I see personally not much reasons to change that, however maybe you do not
mean that?

Cor

"Herfried K. Wagner [MVP]"
...
"Cor Ligthert" <no************@planet.nl> schrieb:
I thought that I answered this as well in the general group.

You place normally your usercontrols globaly (friend) on your form,
therefore they can "talk" to each other everywhere in that class.


The fact that the instances can talk to each other doesn't have much to do
with their modifier. I suggest to set the usercontrol's modifier to
'Protected' (or 'Private'). Notice that this still won't prevent the
usercontrols from communicating.

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

Nov 21 '05 #6
Peter,

That is what I think as well, however that depends how he build them in my
opinion. When the properties in those controls are friend (or Public) than
that should be very easy when those usercontrols are in the same form class.
However maybe I miss something,

Cor
"Peter Proost" <pp*****@nospam.hotmail.com>
Hi Cor,

I think he just want's to get some values from one usercontrol to an other
usercontrol

Peter

"Cor Ligthert" <no************@planet.nl> wrote in message
news:uD**************@TK2MSFTNGP09.phx.gbl...
Hi Chris,

I thought that I answered this as well in the general group.

You place normally your usercontrols globaly (friend) on your form,
therefore they can "talk" to each other everywhere in that class.

Therefore the only thing in my opinion that you have to do is as I as
well
said in the general newsgroup is to select the right tabpage. indexof

which
is a number from 0 to your last page or the tabcontrol.

http://msdn.microsoft.com/library/de...us/cpref/html/
frlrfsystemwindowsformstabcontrolclassselectedtabt opic.asp

However the question seems something else so where do I not understand

you?

Cor

"ChrisK" <ma******@yahoo.fr>
.
> Hi,
>
> I'm beginner with VB.net and i have a trouble... At work, they decided
> to program with tabcontrol...and i'mm in charge of this !
>
> There is my problem.
> I've a form with one tabcontrol (TBC1 ). This TBC1 contents n TabPages
> ( TBP1,2,3,..,n)
> For each TBPn i 've got an specific usercontrol which have controls
> and code ( data access, ... ).
> I want to establish dialog between the different TBP starting from any
> usercontrol.
>
> For example :
>
> TBP1 = UserControl1 (UC1) with ComboBox and CommandButton
> TBP2 = UserControl2 (UC2) with textBox, checkBox, ComboBox and
> CommandButton
>
> When I choose an item in the ComboBox of UC1, i Click on CommandButton
> to fill controls of UC2.
> Finally i want to show TBP2.
>
> I hope it was clear, cos' i'm not speaking english very well, but i
> understand quiet well!
> Briefly my question is :
> How can two USercontrols of different tabpages communicate ?
>
> Thnks for your answers
>
> Best Regards From Paris
>
> Mail_taf



Nov 21 '05 #7
"Cor Ligthert" <no************@planet.nl> schrieb:
I can be wrong, however I thought that when you drag them on your form
they are automaticly set to Friend, that was what I tried to tell.
ACK.
I see personally not much reasons to change that, however maybe you do not
mean that?


Well, that's personal preference... I don't want to see the controls in
IntelliSense when I work on a variable holding a form's instance.

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

Nov 21 '05 #8
Cor,

I don't think you're missing something because I understood the question in
the same way, or maybe we're both missing something ;-)

Peter

"Cor Ligthert" <no************@planet.nl> wrote in message
news:u6**************@TK2MSFTNGP14.phx.gbl...
Peter,

That is what I think as well, however that depends how he build them in my
opinion. When the properties in those controls are friend (or Public) than
that should be very easy when those usercontrols are in the same form class. However maybe I miss something,

Cor
"Peter Proost" <pp*****@nospam.hotmail.com>
Hi Cor,

I think he just want's to get some values from one usercontrol to an other usercontrol

Peter

"Cor Ligthert" <no************@planet.nl> wrote in message
news:uD**************@TK2MSFTNGP09.phx.gbl...
Hi Chris,

I thought that I answered this as well in the general group.

You place normally your usercontrols globaly (friend) on your form,
therefore they can "talk" to each other everywhere in that class.

Therefore the only thing in my opinion that you have to do is as I as
well
said in the general newsgroup is to select the right tabpage. indexof

which
is a number from 0 to your last page or the tabcontrol.

http://msdn.microsoft.com/library/de...us/cpref/html/ frlrfsystemwindowsformstabcontrolclassselectedtabt opic.asp

However the question seems something else so where do I not understand

you?

Cor

"ChrisK" <ma******@yahoo.fr>
.
> Hi,
>
> I'm beginner with VB.net and i have a trouble... At work, they decided > to program with tabcontrol...and i'mm in charge of this !
>
> There is my problem.
> I've a form with one tabcontrol (TBC1 ). This TBC1 contents n TabPages > ( TBP1,2,3,..,n)
> For each TBPn i 've got an specific usercontrol which have controls
> and code ( data access, ... ).
> I want to establish dialog between the different TBP starting from any > usercontrol.
>
> For example :
>
> TBP1 = UserControl1 (UC1) with ComboBox and CommandButton
> TBP2 = UserControl2 (UC2) with textBox, checkBox, ComboBox and
> CommandButton
>
> When I choose an item in the ComboBox of UC1, i Click on CommandButton > to fill controls of UC2.
> Finally i want to show TBP2.
>
> I hope it was clear, cos' i'm not speaking english very well, but i
> understand quiet well!
> Briefly my question is :
> How can two USercontrols of different tabpages communicate ?
>
> Thnks for your answers
>
> Best Regards From Paris
>
> Mail_taf



Nov 21 '05 #9

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

Similar topics

1
by: ChrisK | last post by:
Bonjour, Débutant en VB.Net, je me trouve devant un souci. Au taf, une solution d'appli par onglet a été retenue...et sur qui ça tombe...sur kiki ! Bref voici mon souci : J'ai une form...
1
by: RA | last post by:
Hi 1) I want to create a TabPage class in design mode - how do I do it? What type of project should I use? Is it going to be a custom control? 2) I have a TabControl that I would like to add to...
2
by: Richard | last post by:
Hi, Simple tabcontrol question: I have a tab control with a number of tabpages on it. What I want is to show a particular tabpage when I click a button that is not on the tabcontrol. Can...
9
by: Michael Turner | last post by:
Hi Guys Having problem with the tab control, I need to set the background color to something different than the standard, I have found code on the web and now can redraw the tabpage buttons so...
5
by: scorpion53061 | last post by:
I am trying to be able to share a groupbox and its related controls among all of my tab pages. This does not error but the controls do not appear either. Thank you for your help!! ...
0
by: Sagaert Johan | last post by:
I have a tabcontrol whith on one of the tabpages a custom control (mycontrol) derived from UserControl. When i call the tabcontrol.TabPages.Clear() , the mycontrol OnLoad events gets called ....
2
by: Kevin | last post by:
Although lots of people described how to workaround the lack of ability to hide and show tab pages on a tab control, I couldnt find a code example so I made one. Create a class that inherits from...
0
by: =?Utf-8?B?TWFydGluIw==?= | last post by:
Hello everybody! Please note that I have posted same question in different forums with no success. So If you tried to help me there, please do not consider the repost as rude! I'm working on...
2
by: Gav | last post by:
I am writing an application where I will have a TabControl and 3 styles of Tabs to go in it, each containing different controls. The tabs will be added to the tabcontrol when items are clicked on...
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...
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...
0
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,...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...

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.