C#中调用VB中Inputbox功能
C#自己没有Inputbox这个类,但是Inputbox也蛮好用的,所以有两种方法可以使用
一:.间接调用vb中的Inputbox功能
1。在项目中添加对Microsoft.VisualBasic引用
2。在项目中添加命名空间Using Microsoft.VisualBasic;
3。以后就可以直接使用VB中的好多类库(爽啊……)
例如:textBox1.Text=Microsoft.VisualBasic.Interaction.InputBox(“提示性文字”, “对话框标题”, “默认值”, X坐标, Y坐标);
上面的 X坐标, Y坐标 可以取值为 –1 和 -1,表示屏幕中间位置显示。
二:还可以自己写一个InputBox()这个函数。动态生成一个FORM以及TEXTBOX和BUTTON等,确定好位置,返回用户输入的字符串。
public partial class InputBox : Form
{
private InputBox()
{
InitializeComponent();
}
public String getValue()
{
return textBox1.Text;
}
public static bool Show(String title,String inputTips,bool isPassword,ref String value)
{
InputBox ib = new InputBox();
if (title != null)
{
ib.Text = title;
}
相关文档:
一:C# 连接SQL数据库
Data Source=myServerAddress;Initial Catalog=myDataBase;User Id=myUsername;Password=myPassword;
Data Source=190.190.200.100,1433;Network Library=DBMSSOCN;Initial Catalog=myDataBase;User ID=myUsername;Password=myPassword;
Server=myServerAddress;Database=myDataBase;User ID=myUse ......
内容提要摘要: The software of visual basic developed by Microsoft corporation is becoming one of the main develop tools at today。 As it's remarkable peculiarity, the Grid control has very great practical and active use。 This topic discusses how to use the grid control of VB to develop prati ......
//向数据库中写入
private void button1_Click(object sender, EventArgs e)
{
oracleConnection1.Open();
& ......
先来写一个简单的Ajax程序,使用非同步的方式向服务器端取得TXT文件中的内容,并加以显示。首先,请准备一个HelloAjax.aspx(HTML也可):
*HelloAjax.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="HelloAjax.aspx.cs" Inherits="HelloAjax._Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD ......
ASP.Net中使用VB.Net调用存储过程并得到返回值
来源:qqread论坛 作者: 出处:巧巧读书 2006-08-03 进入讨论组
//存储过程代码
CREATE PROCEDURE [AddNewInvoiceInfo] (@sUserID int,@sClaimMethod varchar(50),@sInvoiceNum varchar(50),@sInvoiceDate datetime,@sBuyCity varchar(50))AS
Insert Into SMB_In ......