| |

VerySource

 Forgot password?
 Register
Search
View: 879|Reply: 3

problem with statusStrip in winform

[Copy link]

2

Threads

3

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

Post time: 2020-1-4 05:50:01
| Show all posts |Read mode
I placed a statusStrip control in the mdi main form.
I want to let the controls of the main form display information dynamically when the mdi subform is operated. How to achieve?
Understood, can you tell me how to achieve it in general?
Reply

Use magic Report

0

Threads

6

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 Hong Kong

Post time: 2020-8-27 01:15:01
| Show all posts
frmmain.statuslab.text="The information you want to display"
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-8-27 07:45:01
| Show all posts
Set a reference to the main form statusStrip in the subform.

Load the statusStrip when creating the subform.

public class WParent
{
    CreateSon()
   {
      WSon son = new WSon();
     son.statusStrip = this.statusStrip;
   }
}

public class WSon
{
   private statusStrip;
   
   private SomeMethod()
   {
      doSomething();

      this.statusStrip.Text = ".....";
   }
}
Reply

Use magic Report

0

Threads

2

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-9-3 16:45:01
| Show all posts
You may get the controls in the parent form in this way:
StatusStrip st = (StatusStrip)this.ParentForm.Controls["Name"];
In this way, you can control its state just like operating the controls in this form.
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list