Control of NotifyIcon in MDI Parent from MDI child (C# Express)

I have an MDI application with a base(Parent) form (FormA) and several child forms (Form1, Form2, etc). My Parent Form (FormA) is invisible and contains a ContextMenuStrip (contextMenuStrip1) and a NotifyIcon (notifyIcon1). I have 3 Icons defined in my properties.resources
(a yellow, green, and red check mark). I start FormA from Main() in my Program.cs with  Application.Run(new FormA()); . FormA starts and checks various things via code in FormA or in Program.cs, selects the proper icon and sets it, may or may not
create a message balloon depending on what it finds and gives the user access to the ContextMenuStrip by right-clicking the Icon. From the ContextMenuStrip the user can select the various other forms to make certain adjustments. Whichever form is selected
by the user is started with:
Form1 newMDIChild = new Form1();
            // Set the Parent Form of the Child window.
            newMDIChild.MdiParent = this.MdiParent;
            // Display the new form.
            newMDIChild.Show();
Form1 (or Form2 or Form97) starts, checks stuff via routines in Form1 (or 2 or 97) and Program.cs and allows the user to change certain things via  textboxes or run certain routines via buttons that are made visible if appropriate. This all works flawlessly
and I'm happier than a pig in you know what BUT... what I NEED to be able to do is change the Icon in FormA (notifyIcon1.Icon) from a yellow or red check mark to a green one, once things causing a problem are corrected while still remaining in Form1 (and/or
2 and/or 97) to allow other changes to be made. My understanding was that Form Papa = (Form)this.MdiParent; would give me the Parent (FormA) form, but no matter what I have tried, I cannot change notifyIcon1.Icon, so there is an obvious disconnect in
my thinking.
Please understand that I am new at C#. The last time I "mastered" a programming language was in the days of Clipper 5.3 and C (DOS) when OOL was in its' infancy, so my toes got damp but my feet never got truly wet with OOL, so please type slowly
Please understand also that I Understand that MDI is the personification of Satan himself here on Earth, but it is what for now I am stuck with and must solve. If you know better ways of accomplishing what I have described, by all means please point me to
them for future use. I am learning, and will continue to learn until about two weeks after they wrap me in burlap with some heavy stones and drop me off a ship at sea.
My thanks in advance for your patience, understanding and help.
Dan

Hello Dan,
>>Form1 newMDIChild = new Form1();
            // Set the Parent Form of the Child window.
            newMDIChild.MdiParent = this.MdiParent;
            // Display the new form.
            newMDIChild.Show();<<
1. First, I will point that if you called that MDI form with that way, you will not be able to access main form's instance, since you set its mdiparent to the
main form's parent. So I would recommend you change it to the following one.
newMDIChild.MdiParent = this;
If you don't want the main form is mdi container, you could add a property to mdi form and pass the instance directly to that property instead.
2. You could add the following property to the main form class.
public Icon MyIcon
get { return this.notifyIcon1.Icon; }
set { this.notifyIcon1.Icon = value; }
And then inside the MDI form, change that property to the one you want to change the icon to, e.g change it to Icon2.
private void button1_Click(object sender, EventArgs e)
Form1 f1 = (Form1)this.MdiParent;
f1.MyIcon = Properties.Resources.Icon2;
Result:
Regard,
Carl
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey.

Similar Messages

  • Bind Variable Brain Teaser - Accessing a filtered Parent from a Child

    Hi Guys and Gals,
    Using JDev 11.1.2.4.0.
    I have two tables, the parent(Scenarios) and the child (Orders).  They are setup as such:
    SELECT Scenarios.SCENARIO_ID,
                   Scenarios.NAME,
                   Scenarios.COMPANY_ID
    FROM SCENARIOS Scenarios
    WHERE Scenarios.SCENARIO_ID = :pScenarioId
    ORDER BY Scenarios.SCENARIO_ID
    SELECT Orders.ORDER_ID,
                   Orders.COMPANY_ID
    FROM ORDERS Orders
    Scenarios (The Parent) has a required bind variable which filters on the primary key, SCENARIO_ID.  The primary key for the Orders table is Order_ID.  The two tables are joined by an association & view link on COMPANY_ID, setup as a 1-to-* relationship.  However, it is in fact a *-to-* relationship since an Order row can appear in several scenarios.
    In the Orders View Object, I also have a transient attribute, ScenarioInfo, which attempts to access Scenarios's current row to retrieve the name.  The getter is as such:
    public BigDecimal getScenarioInfo() {
         Row row = this.getScenariosView();
         DBSequence db = ((ScenariosViewRowImpl)row).getScenarioId();
         return new BigDecimal(db.getValue());
    The sequence of events:
    1) Open the application module and click on the view link between Scenarios and Orders.  A window pops open asking for the bind variable (pScenarioId) value.  I enter a valid value (2) and hit enter.  This should (in theory) return only one row for the Scenarios view object, the one with the ScenarioId of 2.  Clicking only on the Scenarios view object in the application module verifies this.  The Orders view object then renders, but an error message is displayed attempting getScenarioInfo()
    (oracle.jbo.AttrValException) JBO-27019: The get method for attribute "ScenarioInfo" in Orders cannot be resolved.
    I'm not sure I understand why.  ScenarioId with a value of 2 is a valid number.  With the bind variable / filter in place there should be one row as the parent, turning the relationship into a 1-to-*.  Without the filter in place, I may access the parent without error, but the record that is pulled back is the first possible row due to the 1-to-* relationship.
    Instead of having a bind variable, I have also tried implementing a View Criteria in the app module for the Scenarios view object.  However, the criteria doesn't seem to "stick" when the this.getScenariosView() is called from the Orders view.  It also pulls back the first row.
    Does anyone have any ideas?  The only thing I can think of would be to change the relationship to a *-to-* through a translation table, but that's a complication I do not wish to add if possible.
    Thanks in advance,
    Will

    Here is an alternate approach.  This one removes the bind variable from the Scenarios query and instead implements the following code in the app module impl.
        public void refreshScenario() {
            ViewObjectImpl allScenarios = this.getAllScenarios();
            VariableValueManager manager = allScenarios.getVariableManager();
            manager.setVariableValue("pScenarioId", new BigDecimal(2));
            ViewCriteriaManager criteriaManager = allScenarios.getViewCriteriaManager();
            ViewCriteria vc = criteriaManager.getViewCriteria("ScenariosViewCriteria");
            criteriaManager.applyViewCriteria(vc);
            allScenarios.executeQuery();
    The getter is the same as my second getter example:
        public String getScenarioInfo() {
            // remove the default getter for the transient string variable ScenarioInfo
            // return (String) getAttributeInternal(SCENARIOINFO);
            // get the view link accessor for the parent row, Scenarios
            ScenariosViewRowImpl row = (ScenariosViewRowImpl)this.getScenariosView();
            // This should return 1 row, which would be the row remaining after filtering by the bind variable with a value of 2
            // Get that rows Name attribute
            String s = row.getName();
            return s;
    I run the app module tester and then run the refreshScenarios() method.  I then double-click the view link which pops up a dialog box.  The bind variable pScenarioId is pre-filled with 2.  I click enter a receive the following unexpected output as seen here: http://www.williverstravels.com/JDev/Forums/Threads/11077337/ViewCriteriaAttempt.jpg
    As you can see, the ScenarioInfo column returns "#1" when it should return the parent's Name, which would be "#2".  I am a little confused as to why this is functioning this way.

  • Passing value from mdi child to parent form

    Hallo
    I design project in which is main window with mdi container and mdi child windows. My problem is that so i want to save value from TextBox1 from child form using main menu which is in main window. I don't know how to call content of TextBox1. Here is part
    of code about saving file.
    Private Sub MenuItem5_Click(sender As Object, e As EventArgs) Handles MenuItem5.Click
    If Me.ActiveMdiChild IsNot Nothing Then
    SaveFileDialog1.FileName() = "Nowa metryka"
    SaveFileDialog1.Filter() = "Metryka zaworu bezpieczenstwa (*.mzb) | *.mzb"
    If SaveFileDialog1.ShowDialog() = DialogResult.OK Then
    Dim ZapisywanieTekstu As New IO.StreamWriter(SaveFileDialog1.FileName)
    Dim varZapisywanyTekst As String = ZapisywanieTekstu.AutoFlush
    ZapisywanieTekstu.WriteLine("HERE SHOUL BE A CALL TO TextBox1 VALUE")
    ZapisywanieTekstu.Close()
    End If
    End If
    End Sub
    If somebody have any idea ho to call value of TextBox1 in child form using main form save menu plase give me any help.
    Thank You
    And Best Regards

    Hello,
    I'd ask in
    Windows Forms General.
    Karl
    When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer.
    My Blog:http://unlockpowershell.wordpress.com
    My Book:Windows PowerShell 2.0 Bible
    My E-mail: -join ('6F6C646B61726C40686F746D61696C2E636F6D'-split'(?<=\G.{2})'|%{if($_){[char][int]"0x$_"}})

  • How to make MDI child - parent relationship in java using net beans/

    Hello Expers
    i am going to prepare an application in java.
    for that, i have to establish an MDI child - parent relation between various forms.
    I am preparing that application in net beans.
    Just guide me as early as possible for that as i have to submit that within three days.
    thanks.

    smuwanga
    Please don't post in old threads that are long dead. When you have a question, please start a topic of your own. Feel free to provide a link to an old thread if relevant.
    I'm locking this two year old thread now.
    db

  • Maximize/Minimize MDI Child window

    Dear Members :
    I am on Oracle forms 10.1.2 and irrespective of whether value of separateFrame=true/false, when I try to maximize mdi-sheet window (within application frame), the whole thing flickers and after some time browser crashes. Does "maximize allowed" property not work for child windows in MDI application ?
    Behavior of minimize is also peculiar, as the the whole mdi application frame develops a vertical scroll, when I again try to resize the minimized mdi-sheet window, as it shows up with it's original size down from it's lower position; instead of getting back to where it originally appeared.
    I tried above both using JInitiator and JRE - but same behavior.
    Could anyone please suggest ?
    Thanks in advance.
    Atanu
    Edited by: user11184124 on Sep 28, 2011 3:09 PM

    ...If you want to make your voice heard to the VC++/MFC developer support people via Connect, that is a reasonable option.  If others vote the "me too" there, your suggestions might gather enough weight for some future action.
    <
    Robert, if you do post a bug report on Connect please post a link to
    your bug report back here so we can find it.
    I guess the bug report is really that Windows 8 doesn't draw MDI child
    windows in a consistent style to the top level frame window (I see the
    same thing using Forte Agent, so I don't think it's an MFC issue).
    For instance, if you are asking that MFC include some new visual manager(s) to support the newer Windows 8 appearance,
    Please, no more application specific "visual managers". Don't make it
    easy to make an inconsistent mess of UIs.
    I've just been saddled with a WPF application that's a right mess in
    that respect - some parts change correctly when the user changes the
    Windows scheme to high-contrast, while other parts use AvalonDock with
    its own theme idea of what the colors should be.
    Dave

  • Status bar & MDI Child

    Hi again,
    Now, I am interested in creating a status bar at the bottom of my vi and I want to put the date and time in it or other messages that my application generates. How can I do it?
    and.... How can I do and a MDI child application like in visual basic?
    Finally,
    Is it possible in time execution to show the front panel of my vi without embeding it in a window? LabVIEW always embeds the vi in a window, I would like to not embed it in a window.
    Thanks,
    ToNi.

    I'll start with the easy ones -
    The easy way to put a status bar in your app is probably to devote that area for one, or several, controls which will display what you want. You can decorate that area and customize the controls to have the look you want. If you want it to hover above, I think your best chance is a subVI constantly open in that area.
    Which brings me to the next question - "LV embeds the VI in a window" - I presume you mean the menu bar (the area where the run button and the VI icon are). If so, right click the icon, select VI Properties and go to Window Appearence. Here you customize these options.
    Last one - MDI. If I understand correctly, this is Multiple Document Interface, meaning that you have several child windows sharing the same menus, etc. Like when you open Word and have several documents in the same space or Photoshop and have several pictures in the same space using the same tools. I don't know how this works in VB (how does it work in VB, by the way?), but I don't think this can be done just as easily in LV, since LV is multiplatform and VB (I believe) is windows specific and uses windows options inherently to do this (just a guess, LV also has some windows specific features). Anyway, you can have a seperate VI as your common area and simulate this using subpanels (can be found in the Containers palette, next to the tab control) or using regular subVIs, but you'll probably have to sync all of them somehow. Hope this helps. Maybe I'm wrong and someone will have a better idea.
    Try to take over the world!

  • How can I to control any element of my GUI from another class?

    How can I to control any element of my GUI from another class?

    For that, you need the external class to have the reference to your element.. If your idea is to change basic properties like width, height etc.. then you can have the constructor of the external class to take the object of the parent of your class as the parameter and modify ..
    However, if the properties to be altered/accessed are custom to your element, then you will have to have the class accept an object of your class as the parameter. No other option..
    What exactly is your requirement?

  • Change Parent (Stage) Timeline from a Child (IFrame) Symbol

    Hello,
    Within a project (Project X) I have a symbol (called 'container'). This symbol loads an IFrame of a different Edge HTML5 document (Project Y).
    I would like to click in the nested IFrame (Project Y) and control the timeline of the parent document (Project x).
    Could anyone help me acheive this?
    Thank you.

    Hi, 7Freelance7-
    You should take a look at the section at the bottom of the API doc named "Call Edge Animate APIs on a different compostiion."  It should help you figure out how to grab the handle of another composition, no matter where in the DOM it is.
    http://www.adobe.com/devnet-docs/edgeanimate/api/current/index.html
    Hope that helps!
    -Elaine

  • Automatic status heritage from parent item to child item in Instal Base R12

    Hi,
    Do you know please how to deactive automatic heritage of status from parent item to all child items of instal base when updating parent item status in R12?
    When I update status of package in Instal Base, statuses of all child items are updated automatically with same value.
    I am using R12 standard API's and I don't see any parameter that can help ...
    Must I see the Ebs parameters ? Profile options?
    Thx

    Did you check if the serial ABN656 is the parent and has child components under it? Check the below query for the same. Additionally you can also navigate to Oracle Installed Base Agent User responsibility, search for ABN656, click on the record, navigate to Configuration tab and see if this serial has any child components.
    select *
    from csi_ii_relationships cir
    ,csi_item_instances cii
    where cii.serial_number = 'ABN656'
    and cii.instance_id = cir.object_id
    Thanks
    Shree

  • Is it possible to call a function in a parent component from a child component in Flex 3?

    This is probably a very basic question but have been wondering this for a while.
    I need to call a function located in a parent component and make the call from its child component in Flex 3. Is there a way to access functions in a parent component from the child component? I know I can dispatch an event in the child and add a listener in the parent to call the function, but just wanted to know if could also directly call a parent function from a child (similar to how you can call a function in the main mxml file using Application.application). Thanks

    There are no performance issues, but it is ok if you are using the child component in only one class. Suppose if you want to use the same component as a child to some bunch of parents then i would do like the following
    public interface IParentImplementation{
         function callParentMethod();
    and the parent class should implement this 'IParentImplementation'
    usually like the following line
    public class parentClass extends Canvas implements IParentImplementation{
              public function callParentMethod():void{
         //code
    in the child  you should do something like this.
    (this.parent as IParentImplementation).callParentMethod();
    Here using the Interfaces, we re decoupling the parent and the child
    If this post answers your question or helps, please mark it as such.

  • Calling a Function in the Parent Window from the Child Window

    QUESTION: How do I call a function resident in the parent
    window from a child window?
    BACKGROUND
    I have a JavaScript function resident in the parent window
    that reformats information obtained from the Date object and writes
    the result to the parent window using the document.write( ) method.
    I would like to call this function from the child window and have
    it write to the child window instead. Is this possible? If not,
    must I rewrite the entire function and nest it in the below code?
    If so, what is the proper form of nesting?
    CODE: The code that creates and fills the child window is
    provided below. The highlighted area indicates where I would like
    to enter the information from the function resident in the parent
    window. I have tried every imaginable permutation of code that I
    can imagine and nearly destroyed my parent document in the process.
    I am very happy that I had a back-up copy!
    function openCitationWindow() {
    ciDow = window.open("", "", "width=450, height=175, top=300,
    left=300");
    ciDow.document.write("A proper way to cite a passage of text
    on this page:<br /><br />Stegemann, R. A. 2000.
    <cite>Imagine: Bridging a Historical Gap</cite>. " +
    document.title + ". [<a href='" + location.href + "'
    target='_blank'>online book</a>] &lt;" + location.href
    + "&gt; (");
    MISSING CODE;
    ciDow.document.write(").<br /><br /><input
    type='button' value='Close Window' onclick='window.close()'>");
    ciDow.focus();

    Never mind - I was doing something very stupid and wasn't
    calling the function as a method of a movie clip. I was simply
    calling checkTarget(event) rather than
    event.currentTarget.checkTarget(event); which seems to work.

  • Prevent Active Directory Parent Domain Admins from accessing Child Domain

    We want to prevent Parent domain administrators (or a similar profile?) from accessing and/or administering child domains. Is this possible, or do parent domain admins have irrevocable administrative access to any child domain?
    Asked another way, can a restricted profile be configured for administration of the parent domain that does not cross domain boundaries effectively isolating each domain's administrative needs?
    Thanks in advance for input and advice!
    Best regards.

    Sorry, I was replying again after I read your second paragraph. The parent domain is the Forest root. we have parentdomain.com
    parent.parentdomain.com
    child1.parentdomain.com
    child2.parentdomain.com
    child3.parentdomain.com
    We do not want the Domain Administrator for parentdomain.com to be able to administer, or preferably, even access the Child Domains.
    1.) Can we remove that user from "Enterprise Admin" role and assign a different role so that they can only administer parentdomain.com (effectively demoting that user)?
    2.) Promote a Child.parentdomain.com user to Enterprise Admin?
    Thanks sorry for the confusion.
    Ah ok.
    Yes, you can. the answer is the same basically. The group membership is what counts. So in the child domain, remove the enterprise admins group from the child domain admins groups. OR make sure the domain admins of the forest root are not members of the
    enterprise admins group. that way they are still only admins in the parent domain.
    It is really only depending on group members ship and including those groups in the child domain. by default the enterprise group is included for example, but nothing stops you from removing those groups.
    based on the group membership you can also deny them the ability to log on.
    the only thing you cannot prevent is the forest administrator account from doing something.
    One thing I would like to add though: any admin in the forest domain likely has the ability to still get access if he wants to force his way in.

  • How to make MDI child form

    Dear Seniors,
    I am new to java, I am trying to develop my 1st simple java app using NetBean 6, I have created a MDI form using Swing GUI Forms -> MDI application sample form..
    I also have created a simple form using JFrame, how to make it as MDI child form?
    please help
    Thanks a lot in advance

    my 1st simple java appYou are simply in over your head. Go back to the shallow end of the pool. Slip on some floaties...
    http://java.sun.com/docs/books/tutorial/
    Seriously dude, swing ain't simple, with or without a smartypants GUI building IDE.

  • Transfer Focus From a Child Dialog To its Parent Frame

    Hi
    I m working on a Multimedia Desktop Application. I have done alomst 90% of work. Here I have a problem to transfer focus from a Child Dialog to Parent Frame. Remember the whole applicatio does not use Mouse every thing is handled on key events. So I required to transefer the focus from a Child Dialog to its Parent Frame from key board. I also cant use ALT+TAB because
    1- Child is a dialog
    2- This is a Multimedia Application which will be deployed For TV production and can't allow any Computer
    Components to be viewable.
    So I want only key press to transfer the focus between Child and The Parent.
    Thanks.
    Khurram

    First u tell me what do u do on the forumI answer questions - when I know the answer.
    I give advice on how to use the forums efficiently so you get the best chance to have your question answered and you don't waste other peoples time.
    And the post-URL you mentioned, was mistakenly submitted two times.Then respond to your own thread saying you posted it twice by mistake.
    any ways I did never see any article posted by you, nor the solutions on the other's posts by you. you just made comments on others posts.which only goes to prove that you never bother to search the fourm before you post a question.
    and please let others try to review on my problem.others can still reply

  • HT5858 In control centre some how facebook app is getting displayed I dont want any app to be clickable from control centre how to remove it from control centre panel

    In control centre some how facebook app is getting displayed I dont want any app to be clickable from control centre how to remove it from control centre panel

    .

Maybe you are looking for