Visual Basic Code , VB.NET Code, VB Code
  Home   :  Code   :  Forums   :  Submit   :  Mailing List   :  About   :  Contact


passing variable to a button


passing variable to a button

Author
Message
john_zakaria
john_zakaria
Forum God
Forum God (4.1K reputation)Forum God (4.1K reputation)Forum God (4.1K reputation)Forum God (4.1K reputation)Forum God (4.1K reputation)Forum God (4.1K reputation)Forum God (4.1K reputation)Forum God (4.1K reputation)Forum God (4.1K reputation)

Group: Forum Members
Posts: 10, Visits: 17
hi everyone.. i am using windows application to get data from web service and according to the result an action will be taken



for example if the result is 1 i will download a file and the name of the file will be taken from my database.



all that i need is to pass the name of the file from the form to the button_click Event



my result is:





private void button1_Click(object sender, EventArgs e)

{





WebClient webClient = new WebClient();

webClient.DownloadFileCompleted += new AsyncCompletedEventHandler(Completed);

webClient.DownloadProgressChanged += new DownloadProgressChangedEventHandler(ProgressChanged);

webClient.DownloadFileAsync(new Uri("http://www.myexample.com/john_test/Setup.msi"), @"c:\Setup.msi");



}











i want it to be













private void button1_Click(object sender, EventArgs e)

{





WebClient webClient = new WebClient();

webClient.DownloadFileCompleted += new AsyncCompletedEventHandler(Completed);

webClient.DownloadProgressChanged += new DownloadProgressChangedEventHandler(ProgressChanged);

webClient.DownloadFileAsync(new Uri("http://www.myexample.com/john_test/"+Result), @"c:\"+Result);



}





i want to pass variable to the button or use something like Global variable but i dont know how to use its syntax?

can anyone help me please
Edited
2/13/2011 by john_zakaria
GO


Similar Topics


Reading This Topic


Login
Existing Account
Email Address:


Password:


Social Logins

Select a Forum....

















A1VBCode Forums


Search