Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » Newbie corner » Switch control on the main window
Re: Switch control on the main window [message #46238 is a reply to message #46235] Thu, 31 March 2016 19:36 Go to previous messageGo to previous message
Lance is currently offline  Lance
Messages: 527
Registered: March 2007
Contributor
Use Switch's SetData( indexOfItemToBeSelected) to do that, here is a small example:

#include <CtrlLib/CtrlLib.h>

using namespace Upp;

struct MyApp: public TopWindow
{
	MyApp()
	{
		s.SetLabel("Label\nArray\nButton\nSwitch");
		Add(s.SizePos());
		

                s.SetData(3);  //<----------- 
	}
	
	Switch s;
};


GUI_APP_MAIN
{
	MyApp().Run();
}
 
Read Message
Read Message
Read Message
Previous Topic: Selecting MYAPPS after starting theide.exe it is blank
Next Topic: How to set the font controls?
Goto Forum:
  


Current Time: Tue May 14 09:21:17 CEST 2024

Total time taken to generate the page: 0.02487 seconds