有人可以通过一些代码告诉我如何从另一个类调用位于Form类中的函数吗?
有些代码会有很大的帮助!
谢谢
编辑:这是我目前的代码
public partial class frmMain : Form
{
//*******Class Instances*******
ImageProcessing IP = new ImageProcessing();
//********************
public void StatusUpdate(string text)
{
tlsStatusLabel.Text = text;
}//
public frmMain()
{
InitializeComponent();
}//
}
class ImageProcessing
{
private void UpdateStatusLabel(frmMain form, string text)
{
form.StatusUpdate(text);
}//
private UpdateLabel()
{
UpdateStatusLabel(frmMain, "Converting to GreyScale");
}
}
Run Code Online (Sandbox Code Playgroud)
我遇到的问题是与frmMain.
我需要一个函数,通过该函数我可以将数字转换为给定倍数的最接近值.
例如,我想要一个数字数组设置为16的neareast倍数,所以2 = 0,5 = 0,11 = 16,17 = 16,30 = 32等
谢谢
我在网页中有一个表单,我希望将所选项目放在下拉列表中的测试框中.我现在的代码如下:
<form action = "">
<select name = "Cities">
<option value="----">--Select--</option>
<option value="roma">Roma</option>
<option value="torino">Torino</option>
<option value="milan">Milan</option>
</select>
<br/>
<br/>
<input type="button" value="Test">
<input type="text" name="SelectedCity" value="" />
</form>
Run Code Online (Sandbox Code Playgroud)
我想我需要使用javascript ....但任何帮助?:-)
谢谢
我正在使用C#,并将图像存储在对象Bitmap中.
现在我想将此图像转换为8位灰度,然后转换为4位灰度图像.
你有什么提示可以做到这一点吗?
我想有一个函数,我将输入一个数组,因此我需要另一个数组和一个整数值.这可能吗?
例:
private int[] FunctionName (int[] InputArray)
{
//some function made here
int intResult = xxxxx
int[] array = xxxxx
return intResult; //but here i need also to pass the new array!
}
Run Code Online (Sandbox Code Playgroud)
编辑:
我需要的是以下(更新);
我有一个函数,作为输入什么都不需要,但内部生成两个项目 - 数组+整数.我需要退回这两件物品吗?你能告诉我怎么才能使用这些物品吗?
怎么做到这一点?
我有一个小的PHP页面,其中包含两个下拉列表
我需要根据在第一个下拉列表中选择的结果来填充第二个。换句话说,我需要使用从第一个下拉列表中选择的值,并在用于填充第二个下拉列表的dB查询中使用它(但应在选择第一个下拉列表时填充它。
如果可能的话,请提示吗?(您可以假设我能够从dB填充第一个下拉列表)
谢谢
我正在使用C#编写应用程序,我想从外部文件中读取一些参数,例如文本文件.参数将以文件的形式保存在文件中
parA = 5
parB = hello
etc
Run Code Online (Sandbox Code Playgroud)
你能否请求我如何做到这一点?
我想要一个函数将单维数组int [480000]转换为大小为int [800,600]的二维数组.你能帮我解决一下如何做到这一点吗?
在C#中传输图像的最佳方法是什么?
我正在尝试编写一个函数,当输入采用包含单词的字符串并删除所有单个字符单词并返回没有删除字符的新字符串
例如:
string news = FunctionName("This is a test");
//'news' here should be "This is test".
Run Code Online (Sandbox Code Playgroud)
你能帮忙吗?