| |

VerySource

 Forgot password?
 Register
Search
View: 666|Reply: 2

Novice help-public incident problem

[Copy link]

1

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-1-5 14:10:01
| Show all posts |Read mode
I just started learning C # and want to know the common events of a group of radio buttons,
E.g:
There are three radio buttons rbNone, rbSingle and rbFixed3D
The code added in this way has no effect. Is there anything else to be set in a file?
Please masters to tell my brother
private void ChangeSplitterBorderStyle (object sender, EventArgs e)
        {
            if (rbNone.Checked == true)
                splitter1.BorderStyle = System.Windows.Forms.BorderStyle.None;
            else if (rbSingle.Checked == true)
                splitter1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            else if (rbFixed3D.Checked == true)
                splitter1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
        }
Reply

Use magic Report

0

Threads

56

Posts

21.00

Credits

Newbie

Rank: 1

Credits
21.00

 China

Post time: 2020-1-6 08:45:01
| Show all posts
Adding bindings to events at runtime
rbNone.CheckedChanged + = new System.EventHandler (ChangeSplitterBorderStyle);
rbSingle.CheckedChanged + = new System.EventHandler (ChangeSplitterBorderStyle);
rbFixed3D.CheckedChanged + = new System.EventHandler (ChangeSplitterBorderStyle);

Or select the ChangeSplitterBorderStyle method in the drop-down arrow to the right of ChecekedChanged in the event list of rbNone, rbSingle, rbFixed3D control at design time
Reply

Use magic Report

1

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

 Author| Post time: 2020-1-6 11:06:01
| Show all posts
Thank you, the problem is solved, it is not easy to sing a book by yourself!
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