使用C#从Form调用函数到另一个表单 [英] call a function from Form to another form using C#

查看:213
本文介绍了使用C#从Form调用函数到另一个表单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用第一种形式调用第二种形式的void函数是一个问题吗?我无法立即启动它,因为在出​​现void函数之前需要先检查某些条件..

is it a problem to call a void function in the 2nd form using 1st form? i cannot start it immediately because of there are certain condition need to go through first before that void function can appear..

推荐答案

Yes,
First of that you have to know that 
A void method by default is Private.
An you can not access a Private method from Another class
So you have to declare as Public
Like:
Public void YourMethodName()
{
//Input your data
}


这篇关于使用C#从Form调用函数到另一个表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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