Skip to content

VB -> C#: Convert MsgBox to MessageBox.Show #1166

@RDH1066

Description

@RDH1066

VB.Net input code

MsgBoxResult MsgBoxRet;
...
 MsgBoxRet = MsgBox(sMLS, MsgBoxStyle.Question Or MsgBoxStyle.YesNo, Application.ProductName.ToString())

...
if (MsgBoxRet == MsgBoxResult.Yes)

Erroneous output

 MsgBoxRet = Interaction.MsgBox(sMLS, MsgBoxStyle.Question | MsgBoxStyle.YesNo, Application.ProductName.ToString());

Expected output

DialogResult MsgBoxRet;
...
MsgBoxRet = MessageBox.Show(sMLS, Application.ProductName, MessageBoxButtons.YesNo, MessageBoxIcon.Question);
...
if(MsgBoxRet == DialogResult.Yes)
...

Details

  • Product in use: VS extension / Microsoft Visual Studio Professional 2022 (2) (64-Bit)
  • Version in use: 9.2.6.0 / 17.12.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    VB -> C#Specific to VB -> C# conversion

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions