Unreachable code detected in case statement

前端 未结 14 2462
终归单人心
终归单人心 2020-12-06 16:37

I have a code:

    protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
    {
        switch (keyData)
        {
            case Keys.Alt|Ke         


        
14条回答
  •  既然无缘
    2020-12-06 17:04

    break is not necessary if all paths in a case statement end with a return. Do not use it then, otherwise you will get the mentioned warning.

提交回复
热议问题