Getox Posted September 15, 2005 Posted September 15, 2005 Is there any way to make a global string? i want to have 2 forms, and in Form2 the user will type some text into a textbox, and then when they click an OK button, it will add this text to a string which will then be usable in Form1 Quote Page Edit 2.0 Alpha 2 OUT NOW! - Download Now -
*Experts* DiverDan Posted September 16, 2005 *Experts* Posted September 16, 2005 (edited) To setup a global variable in Form1 declare a variable Public Shared...Public Shared myVaiable As String. Then from Form2 use Form1.myVaiable = "my string". And try http://testing123.info/threads/93824/ for configuring a delegate for your Button1.Click. However..... In most opinions it is better to add a new class to your project and use a public properity to store the variable. There is a post "Global Variables" on this site that goes into more detail why this is a better approach. Edited September 16, 2005 by DiverDan Quote Member, in good standing, of the elite fraternity of mentally challenged programmers. Dolphins Software
Getox Posted September 16, 2005 Author Posted September 16, 2005 Hey thanks for that, Works like a charm. Quote Page Edit 2.0 Alpha 2 OUT NOW! - Download Now -
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.