Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
RDH1066 opened this issue Feb 4, 2025 · 0 comments
Open

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

RDH1066 opened this issue Feb 4, 2025 · 0 comments
Labels
VB -> C# Specific to VB -> C# conversion

Comments

@RDH1066
Copy link

RDH1066 commented Feb 4, 2025

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
@RDH1066 RDH1066 added the VB -> C# Specific to VB -> C# conversion label Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
VB -> C# Specific to VB -> C# conversion
Projects
None yet
Development

No branches or pull requests

1 participant