So, in Visual C#, You were able to declare variables for everything to use. Like this:

namespace MrTwitterStalker
{
    public partial class Form1 : Form
    {
        string fullUrl;
        public Form1()
        {
            InitializeComponent();
        }

     
        private void button1_Click(object sender, EventArgs e)
        {
            fullUrl = "http://www.rawrs.com/";
        }
        
        
        }
    }

but for some reason, I can't do this for VC++. Any ideas?

If you're using it just within your Form class declare it as a public private or protected member of that class. Start from public ref class Form1 : public System::Windows::Forms::Form and scroll down you'll hit an area where your buttons, webbrowsers, etc. are declared. Put it somewhere in there or where you will remember about it.

If you need to share it across forms possibly declare it outside of the class (like under the using directives) but with that comes all of the hazards, pitfalls, and gotchas associated with global variables (the solution above isn't much better but it fits in the with Form.h "culture").

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.