ShowDialog not opening form Visual Studio
when i try to open a form on visual studio, it doesn't work. i've tried many solutions but it still doesn't work, could the problem be in a different code? here is the code that i am using:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace VBR_Application
{
public partial class addNewGT : Form
{
public addNewGT()
{
InitializeComponent();
}
private void addOnline_Click(object sender, EventArgs e)
{
var newForm = new AddOnline();
newForm.Show();
}
}
}
c#
add a comment |
when i try to open a form on visual studio, it doesn't work. i've tried many solutions but it still doesn't work, could the problem be in a different code? here is the code that i am using:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace VBR_Application
{
public partial class addNewGT : Form
{
public addNewGT()
{
InitializeComponent();
}
private void addOnline_Click(object sender, EventArgs e)
{
var newForm = new AddOnline();
newForm.Show();
}
}
}
c#
2
You aren't callingShowDialog
.
– mjwills
Nov 21 '18 at 8:53
5
Please put a breakpoint onvar newForm = new AddOnline();
. Run the code. click the button. Does the breakpoint get hit?
– mjwills
Nov 21 '18 at 8:54
add a comment |
when i try to open a form on visual studio, it doesn't work. i've tried many solutions but it still doesn't work, could the problem be in a different code? here is the code that i am using:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace VBR_Application
{
public partial class addNewGT : Form
{
public addNewGT()
{
InitializeComponent();
}
private void addOnline_Click(object sender, EventArgs e)
{
var newForm = new AddOnline();
newForm.Show();
}
}
}
c#
when i try to open a form on visual studio, it doesn't work. i've tried many solutions but it still doesn't work, could the problem be in a different code? here is the code that i am using:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace VBR_Application
{
public partial class addNewGT : Form
{
public addNewGT()
{
InitializeComponent();
}
private void addOnline_Click(object sender, EventArgs e)
{
var newForm = new AddOnline();
newForm.Show();
}
}
}
c#
c#
edited Nov 21 '18 at 13:43
Lennart
6,122125166
6,122125166
asked Nov 21 '18 at 8:52
V. ProjectsV. Projects
1
1
2
You aren't callingShowDialog
.
– mjwills
Nov 21 '18 at 8:53
5
Please put a breakpoint onvar newForm = new AddOnline();
. Run the code. click the button. Does the breakpoint get hit?
– mjwills
Nov 21 '18 at 8:54
add a comment |
2
You aren't callingShowDialog
.
– mjwills
Nov 21 '18 at 8:53
5
Please put a breakpoint onvar newForm = new AddOnline();
. Run the code. click the button. Does the breakpoint get hit?
– mjwills
Nov 21 '18 at 8:54
2
2
You aren't calling
ShowDialog
.– mjwills
Nov 21 '18 at 8:53
You aren't calling
ShowDialog
.– mjwills
Nov 21 '18 at 8:53
5
5
Please put a breakpoint on
var newForm = new AddOnline();
. Run the code. click the button. Does the breakpoint get hit?– mjwills
Nov 21 '18 at 8:54
Please put a breakpoint on
var newForm = new AddOnline();
. Run the code. click the button. Does the breakpoint get hit?– mjwills
Nov 21 '18 at 8:54
add a comment |
2 Answers
2
active
oldest
votes
Did you mean?
private void addOnline_Click(object sender, EventArgs e)
{
var newForm = new Form();
newForm.Show();
}
Almost certainly not.Form
is the base class for all forms, it's not a specific form
– Panagiotis Kanavos
Nov 21 '18 at 9:37
I know, but did he mean that he just can't open a new form? OrnewForm.ShowDialog();
– user10684840
Nov 21 '18 at 9:51
add a comment |
If you want show a built in dialog you can use this one
MessageBox.Show(this, "Title", "Message");
If you want a custom dialog you can also use this one
_FormDialog dialog = new _FormDialog(this);
dialog.ShowDialog();
_FormDialog is the widows form you have created.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53408294%2fshowdialog-not-opening-form-visual-studio%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Did you mean?
private void addOnline_Click(object sender, EventArgs e)
{
var newForm = new Form();
newForm.Show();
}
Almost certainly not.Form
is the base class for all forms, it's not a specific form
– Panagiotis Kanavos
Nov 21 '18 at 9:37
I know, but did he mean that he just can't open a new form? OrnewForm.ShowDialog();
– user10684840
Nov 21 '18 at 9:51
add a comment |
Did you mean?
private void addOnline_Click(object sender, EventArgs e)
{
var newForm = new Form();
newForm.Show();
}
Almost certainly not.Form
is the base class for all forms, it's not a specific form
– Panagiotis Kanavos
Nov 21 '18 at 9:37
I know, but did he mean that he just can't open a new form? OrnewForm.ShowDialog();
– user10684840
Nov 21 '18 at 9:51
add a comment |
Did you mean?
private void addOnline_Click(object sender, EventArgs e)
{
var newForm = new Form();
newForm.Show();
}
Did you mean?
private void addOnline_Click(object sender, EventArgs e)
{
var newForm = new Form();
newForm.Show();
}
answered Nov 21 '18 at 9:25
user10684840
Almost certainly not.Form
is the base class for all forms, it's not a specific form
– Panagiotis Kanavos
Nov 21 '18 at 9:37
I know, but did he mean that he just can't open a new form? OrnewForm.ShowDialog();
– user10684840
Nov 21 '18 at 9:51
add a comment |
Almost certainly not.Form
is the base class for all forms, it's not a specific form
– Panagiotis Kanavos
Nov 21 '18 at 9:37
I know, but did he mean that he just can't open a new form? OrnewForm.ShowDialog();
– user10684840
Nov 21 '18 at 9:51
Almost certainly not.
Form
is the base class for all forms, it's not a specific form– Panagiotis Kanavos
Nov 21 '18 at 9:37
Almost certainly not.
Form
is the base class for all forms, it's not a specific form– Panagiotis Kanavos
Nov 21 '18 at 9:37
I know, but did he mean that he just can't open a new form? Or
newForm.ShowDialog();
– user10684840
Nov 21 '18 at 9:51
I know, but did he mean that he just can't open a new form? Or
newForm.ShowDialog();
– user10684840
Nov 21 '18 at 9:51
add a comment |
If you want show a built in dialog you can use this one
MessageBox.Show(this, "Title", "Message");
If you want a custom dialog you can also use this one
_FormDialog dialog = new _FormDialog(this);
dialog.ShowDialog();
_FormDialog is the widows form you have created.
add a comment |
If you want show a built in dialog you can use this one
MessageBox.Show(this, "Title", "Message");
If you want a custom dialog you can also use this one
_FormDialog dialog = new _FormDialog(this);
dialog.ShowDialog();
_FormDialog is the widows form you have created.
add a comment |
If you want show a built in dialog you can use this one
MessageBox.Show(this, "Title", "Message");
If you want a custom dialog you can also use this one
_FormDialog dialog = new _FormDialog(this);
dialog.ShowDialog();
_FormDialog is the widows form you have created.
If you want show a built in dialog you can use this one
MessageBox.Show(this, "Title", "Message");
If you want a custom dialog you can also use this one
_FormDialog dialog = new _FormDialog(this);
dialog.ShowDialog();
_FormDialog is the widows form you have created.
answered Nov 21 '18 at 9:32
klitzklitz
285
285
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53408294%2fshowdialog-not-opening-form-visual-studio%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
2
You aren't calling
ShowDialog
.– mjwills
Nov 21 '18 at 8:53
5
Please put a breakpoint on
var newForm = new AddOnline();
. Run the code. click the button. Does the breakpoint get hit?– mjwills
Nov 21 '18 at 8:54