不影响C#winform中的代码或调试 [英] Not effecting the code or debugg in C# winform

查看:92
本文介绍了不影响C#winform中的代码或调试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我正在使用C#winform.

我创建了一个表单并开始编码,在表单负载中,我编写了Messagebox.Show ("Hi"),并将断点放置在了负载中.

它现在影响表格.它没有显示消息框,我无法进行调试.

请帮帮我.

我需要紧急.

Hi All,

I am working on C# winform.

I created a form and started coding, in the form load I wrote Messagebox.Show ("Hi") and also putted the break point in the load.

Its effecting the form now. Its not displaying the message box and I can''t do the debugging.

Please help me.

I need urgent.

推荐答案

从这样简短的描述中很难判断是怎么回事,但是很容易猜到:

您的断点在MessageBox语句上或之前.设置断点后,调试器将在该语句的开头停止执行.因此,如果您有三行内容:
It''s difficult to tell what is going on from such a brief description, but at a guess:

Your breakpoint is on or before the MessageBox Statement. When you set a breakpoint, the debugger stops executing at the beginning of that statement. So if you have three lines:
int i = 1;
MessageBox.Show("Hi");
int j = i * 2;

然后设置MessageBox行的断点,在显示消息"框之前,将执行"i = 1"语句,然后调试器将停止执行.

运行程序,并在出现断点时,使用"Step Over"按钮(或按F10键)执行单个语句.

如果这不是问题,那么我们需要更多详细信息才能提供帮助.

And you set a breakpoint of the MessageBox line, the "i = 1" statement will be executed, and then the debugger will stop executing, before the Message box is shown.

Run your program, and when the breakpoint occurs, use the "Step Over" button (or press F10) to execute a single statement.

If this isn''t the problem, then we need more details to be able to help.


您好,

将断点放在大括号处...

Hi,

Put the break point at curly braces...

private void Form1_Load(object sender, EventArgs e)
{
    //MessageBox.Show(this, "Hi");
    MessageBox.Show("Hi"); 
}



这正在起作用...
有什么问题?

问候



this is functioning...
what''s the problem?

Regards,


如何创建FormLoad事件?

我认为您最好双击您的表单窗口以创建您的事件,然后将源代码添加到新的
How do you create your FormLoad Event ?

I think you''d better double click yours form window create yours event , and add your source in new on


这篇关于不影响C#winform中的代码或调试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆