在我的Windows应用程序中应用progressBar。 [英] Applying progressBar in my Windows Application.

查看:76
本文介绍了在我的Windows应用程序中应用progressBar。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的Win应用程序中,有一个 ServerConnection 表单。



使用此 ServerConnection 表单,用户可以与 SQL Server 建立连接。



ServerConnection 表单中, Connect 按钮用于连接操作。我想应用 ProgressBar 控件,当用户点击 Connect 按钮 ProgressBar 控制将进行,然后建立与 SQL Server 的连接。我只写连接代码如下: -

In my Win Application, there is a ServerConnection Form.

By using this ServerConnection Form the user can establish a connection with SQL Server.

In the ServerConnection Form a button "Connect" is used for connection operation. I want to apply a ProgressBar control, when the user will click the "Connect" button the ProgressBar control will progress then establish the connection to SQL Server. I write only the connection code are as follows:-

if (comboBox1.Text == "SQL Server  Authentication")
{
    Class1.cs = "Data Source= " + System.Environment.MachineName + ";Initial Catalog=Kolkata_Dental;User ID=" + textBox2.Text + ";Password=" + textBox3.Text + "";
                
    SqlConnection con = new SqlConnection();
    con.ConnectionString = Class1.cs;
    con.Open();
    Class1.connection = true;
    MessageBox.Show("Connection estabilished Successfully!!!");
    con.Close();
    Home_Page frm = new Home_Page();
    frm.Show();
    this.Hide();
}



我不知道应该编写什么代码来使用此代码应用 ProgressBar 控件。

请提供代码来解决它。


I don't know what code should I write to apply ProgressBar control with this code.
Please provide me code to solve it.

推荐答案

看看下面的文章并了解它。



1. 如何在Windows应用程序中使用c#.net [ ^ ]。

2. ProgressBar [ ^ ]。
Take a look at the below articles and get the idea.

1. how to use progressbar control in windows application using c#.net[^].
2. ProgressBar[^].


这篇关于在我的Windows应用程序中应用progressBar。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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