473,657 Members | 2,405 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Access User Control from another User control in Winforms - C#

1 New Member
hello -

I am newbie in winforms and c#.

i have a mainform.cs and it has 2 user controls - leftView and rightView.

In leftView.cs i am instantiating a new clientLeftView( another user control) and also the clientRightView (another user control)

Now clientLeftView has a lstClient - list box.

clientRightView has a tab control with 3 tab pages.
- first tab page has the client username, client first name, client last name.
- second tab page has the locations information and a dataviewgrid
- third tab page has the software license information and a dataviewgrid

What should happen?

When a specific client is selected from the lstClient from the clientLeftView, the respective details of the client from the clientRightView has to displayed.

Now for this purpose i am trying to access the clientRightView from clientLeftView user controls - but i am not knowing how to do it.

I tried to use the EventHandler but i am not knowing how exactly to do it.

Any tips/ideas/code are really appreciated.

Thanks,
kumar
Nov 2 '06 #1
2 10096
seishin
2 New Member
hey!
I suppouse you're using some data source. so the easiest way is to make a typed data set and in it create the table(s) representing proper querries from your data source...
project->add->new item->DataSet..
in the dataset designer:
rigth click->add->table adapter
in the last page of the wizard uncheck all options.. the wizard will generate a table..
then you put na object of your dataset class on the form, then add a binding source object and set it's data soudce property to the dataset you added and the datamember property to desired table. next set controls datasource and property to the binding source and the databindings->text to proper field in the selected table
Dec 11 '06 #2
ferguslogic
5 New Member
Ahhh an easy one. Don't overthink it.

Create a class and call it something Like controlManager.
Fire events from your controls and subscribe to them and handle them in this control.

When something occurs on the left control fire an event. Handle it in the controlManager and update the right control from that class. Don't worry about talking to the controls directly. Let the class receive messages and dipatch them appropriately.

: )
Dec 12 '06 #3

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

Similar topics

13
2930
by: bill | last post by:
I am trying to convince a client that dotNet is preferable to an Access project (ADP/ADE). This client currently has a large, pure Access MDB solution with 30+ users, which needs to be upgraded. I believe a dotNet solution is better, but I'm trying to be as convincing as possible -- and maybe I'm wrong! I would appreciate any input or references which could help me.
3
3630
by: Roy Osherove | last post by:
Hi folks. I have an ASP.Net application that runs a .Net dll that uses WMI and ADSI(both managed) to connect to a given IIS root and search through it. When not using the ASP.Net client, but running from a winforms project - I can connect to both local and remote machines. However, when using the ASP.Net project - I get an "Access denied" exception. This happens when calling the ManagementScope.Connect() method.
5
1952
by: jqpdev | last post by:
Hello all... I'm coming from a Borland Delphi background. Delphi has a specific component called a Data Module. In the designer the Data Module behaves like a windows form. A developer can drop non-visual (controls) on the data module surface and wire them up and create procedures, functions, event procedures. In the source file (code behind file) the Data Module is a class, and the dropped components are public properties. The...
5
2025
by: Burton Roberts | last post by:
When using ASP.NET and an OleDBConnection control I get this error on CNN.Open: "The Microsoft Jet database engine cannot open the file 'C:\A2K\Backups\EdsBe2K.mdb'. It is already opened exclusively by another user, or you need permission to view its data." I have tried using a connection string, too, to no avail. However, when I am in Windows Forms I have no problem opening the same file
24
1911
by: Rob R. Ainscough | last post by:
VS 2005 I have: ClickOnce deployment User's that hate and or don't want to use an IE Client (don't blame them) I don't see how ASPX web pages are going to survive? With .NET 2.0 and clickonce deployment my app is 427KB (even with modem dialup speed it doesn't take long to download) -- the user gets a very friendly secure WindowsForm app (most of them don't even notice they're not under IE anymore) that performs considerably faster than...
5
4078
by: Segfahlt | last post by:
I need a little help here please. I have 2 win forms user controls in 2 different projects that I'm hosting in 2 different virtual directories. The controls have been test and operate okay in both projects. Both controls(dlls) have been signed using SN.exe and I've set up the appropriate .Net assembly permissions using those Strong Names The DLL's have been copied to the /bin directory in both web virtual directories.
0
2485
by: jonathan.beckett | last post by:
I have been working on a client project recently that is using winforms ..NET user controls within web pages in Internet Explorer, and need to find out how to make the user control communicate back to the webpage (typically to tell it that it has finished doing something). I started digging around and found out that I needed to implement a COM interface for the .NET user control, and pick up the events from that in Javascript on the...
1
2472
by: Ralph | last post by:
Okay I have a website where the user is going to hit a button to kick off a process that is going to take a long amount of time. Is there anyway without using AJAX, or possibly a windows control on a page that connects to a webservice to show the user the progress of this operation. It seems almost a given that I must use either ajax or some kind of control to do this. Any suggestions would be greatly appreciated. So far I have come up...
1
2534
by: ben.brearley | last post by:
Hi All, Does anyone know of any way to launch C# forms from an MS Access application? Weird question I suppose, but the reason is that I am wanting to rewrite a MS Access application into a C# winforms app. The problem is, it has to be an incremental process, and it would be nice if the user didn't have to run a winforms app for one part of the system, and the old MS Access app for another part.
0
8420
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8324
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8842
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8516
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
8617
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7353
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5642
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4173
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2743
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.