I do not use visual studio so am not sure about the windows forms, i imagine that requires you coding in the winApi though, and you are not going to like that... although like i say i am not a user of vc.
The simplest option for you really might be to code it in the VBA runtime directly within Excel. It has a simple forms developer that you can use to add control buttons and text input. And VBA coding is a lot easier than C++. It will not run as fast as a stand alone application though.
You cannot find 'set code' as your app will have its own requirements surely? You need to understand that with the GUI programming some of the hard work is managed for you...and some isn't. Your buttons and other 'widgets' have certain default behavious, and they communicate with the main 'run' loop on a level that is not neccesarialy directly exposed to you the programmer. This means that the basic mouse event handling etc is done for you unless you modify things.
This also means that you can click on a button and it will show visual response, but nothing will happen. In general you would need to learn how a 'callback' works, this is a function which you can 'attach' to your button and thus have your own code execute on buttonclick.
Here is a callback from the program in the screenshot, the comments were my exisiting ones only by the way
Code:
void ListBuilder::SiteButtonCB_i(Fl_Widget* wgt, void* v)
{
Fl_Button* button = (Fl_Button*) wgt;
string btnLabel = button->label();
if(btnLabel == "OK")
{
GetActiveSites();
startBtn->activate(); //can start now as this button is only lit when a site selected
if(bookedCust) //can only use publicaiton selection if not draft customer run
allPubsChk->activate();
button->deactivate(); //deactivate unless user again goes in and clicks a new box, in which case it will activate again.
}
else //user cancelled custom site selection, reset the gui group
{
SelectAllSites(); //otherwise select it and show all checkboxes selected.
siteGrp->deactivate(); //grey out as all selected by default now
startBtn->activate(); //its ok to start as far as sites go as they all selected now
if(bookedCust) //can only use publicaiton selection if not draft customer run
allPubsChk->activate(); //is ok to allow custom publicatin choosing also now
allSites = true;
}
}
This is the callback attached to the green OK and red cancel buttons. the callback passes a widget pointer in, which in this case i cast to a button and then check the label, this lets me use logic to get more mileage out of a single callback, and makes sense as they are related functionally anyhow.