473,804 Members | 2,246 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

VB2005: Can a usercontrol 'trigger' your main form ?

Hi,

I have a solution containing two projects
- main project with main form containing a statusstrip
- second project containing a usercontrol.

I have added the usercontrol to my main form, all works perfect...

Can my usercontrol 'fire an event' which allows it to change the value(s) on
the main form's statusstrip ?

--
Filip
http://www.ww2airborne.net/
Official Site of the 101st Airborne - 463rd PFA
skype: airborne463pfa-fiwi
[It's nice to be important, but it's more important to be nice!]
----------------------------------------------------------------
Oct 25 '07
13 2427
"Cor Ligthert[MVP]" <no************ @planet.nlschri eb
The question was how to raise and catch an event. In addition,
casting to the parent form type doesn't make the UserControl
reusable.

Strange I read something else, even in the subject.

Something wrong with my newsreader?
I read "Can my usercontrol 'fire an event' ... ?"
Armin
Oct 27 '07 #11
I read "Can my usercontrol 'fire an event' ... ?"
>
There is more Armin, Beside what is before that, is the full sentence you
are refering to. "Can my usercontrol 'fire an event' which allows it to
change the value(s) on the main form's statusstrip ?

Therefore my answer, "You can even get it direct by casting it to the
parentform of the
usercontrol".

I can tell you from own expirience that it is much easier to change the
value(s) on the main form.

Cor
Oct 27 '07 #12
"Armin Zingler" <az*******@free net.deschreef in bericht
news:%2******** ********@TK2MSF TNGP03.phx.gbl. ..
"Cor Ligthert[MVP]" <no************ @planet.nlschri eb
The question was how to raise and catch an event. In addition,
casting to the parent form type doesn't make the UserControl
reusable.

Strange I read something else, even in the subject.

Something wrong with my newsreader?

I read "Can my usercontrol 'fire an event' ... ?"
Armin
Dear readers,
the subject could be confusing.
The goal was to raise an event in the usercontrol, which the main form could
trigger.
In this case I have an event on the usercontrol, when raised I want the main
form
to pick it up and show a message on the statusstrip.
I was able to do this which I explained in an earlier post here in this
topic/message.
Thanks for your help.
--
Filip
http://www.ww2airborne.net/
Official Site of the 101st Airborne - 463rd PFA
skype: airborne463pfa-fiwi
[It's nice to be important, but it's more important to be nice!]
----------------------------------------------------------------
Oct 29 '07 #13
"Cor Ligthert[MVP]" <no************ @planet.nlschre ef in bericht
news:DD******** *************** ***********@mic rosoft.com...
Screaming Eagles,

You can even get it direct by casting it to the parentform of the
usercontrol.

Cor

Cor, and other readers,

I also found out that it is a nice working solution to
add all my Events to a Class,
and declare them SHARED (very important).

In the same class I have the subroutines
which perform the RaiseEvent for each Event.

Once I instantiated the class - withEvents -
on my forms I have instant access to the shared events.

Works like a charm !

--
Filip
http://www.ww2airborne.net/
Official Site of the 101st Airborne - 463rd PFA
skype: airborne463pfa-fiwi
[It's nice to be important, but it's more important to be nice!]
----------------------------------------------------------------
Oct 30 '07 #14

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

Similar topics

2
8317
by: Jaikumar | last post by:
Hi, 1) I have created one windows application, In the main form ( form1) i have added one usercontrol (usercontrol1), In that user control i am drawing one image. 2) In the UserControl1 i am showing one transparent form (form3) when ever user preseed left mouse button. 3) The form3 has one transparent user control (usercontrol2) that paints circles. That measn the circles will show on top the usercontrol1 image. 4) The form3 border style...
4
6683
by: Rob Koch | last post by:
What's the best way to refresh a usercontrol using a parameter? My usercontrol is just a DataList that retrieves data from SQL in association with a public propterty. I click on a LinkButton in my main page (ASPX), but it still refreshes the entire page... I only want the UserControl to blink and come back with new data. What's the direction I should be looking at? Even if I do it via JavaScript, how would I refresh the UserControl...
2
1251
by: Lau Lei Cheong | last post by:
Hello, I'm writing a usercontrol that contains a property named "disabled". It is set to false by default but there is also another button in the usercontrol that'll set it to true. On the main form a number of them are displayed. During the On_Load event, 1) It'll check to see if the usercontrol is disabled. If true, the row containing the usercontrol is hidden.
21
1907
by: Simon Verona | last post by:
Hope somebody can help! I want to automatically be able to add code to the initialize routine on a Windows form when I add a custom control that I've written to a form. Specifically, I'm trying to data bind to a normal class. So I've extended the standard text box to include a field for object name and property name. I want to be able to add a line such as : controlname.DataBindings.Add("Text", objectName, "myPropertyName") I've...
41
4337
by: JohnR | last post by:
In it's simplest form, assume that I have created a usercontrol, WSToolBarButton that contains a button. I would like to eventually create copies of WSToolBarButton dynamically at run time based on some initialization information obtained elsewhere. Basically, I'm going to create my own dynamic toolbar where the toolbarbuttons can change. I'm not using the VB toolbar because of limitations in changing things like backcolor (I can't get...
2
8935
by: Rene Sørensen | last post by:
In VS 2005 I'm trying to create a usercontrol, but I have some problems with it right now I can't figure out how to fix. The size of my usercontrol is "Size 574; 619" I have anchored all controls added to the form, so I can resize it up and down, and not left and rigth. My usercontrol is a usercontrol project. In my main program I just drag and drop the control from the Toolbox, her the problems starts, the size of all subcontrols changes...
10
2432
by: Benton | last post by:
Hi there, I have a UserControl with a couple of textboxes and a couple of buttons ("Save" and "Cancel"). The Click event for this buttons is in the UserControl's codebehind of course, so here's my question. Once the UserControl is dropped onto the container page, how can I perform some action on the codebehind of the container page from the codebehind of the UserControl? For instance, suppose that the UserControl is dropped inside one...
7
4986
by: Edwin Martinez | last post by:
Hello I have a parent form but I want to create 4 forms that will be shown in a area inside the parent form when I click to buttons. +----------------------------+ | Parent Form | | | | -------------------- | | | subform | | | | | | | | | |
0
1103
by: luckilian | last post by:
Hi everyone, i need some help with a tabbed interface. I have this scenario: 1 Main Form 1 UserControl 1 Form when main form is loaded the Usercontrol load .. In the _load handler i want to open then Form in separate thread
0
10600
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
10351
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
10096
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...
1
7638
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6866
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
5534
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...
0
5673
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3834
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3002
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.