RE: [Dev-C++] Creating controls based on a database
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: P.D. v. Z. <pa...@my...> - 2003-08-20 11:08:45
|
Well that should be easy. You could for instance use the row's ID (from the database) as the identifier (and add a fixed number to it so you know it won't conflict with your other controls). It's usually wise to maintain the original database ID anyway, since you will probably want to do something with that data later, and maybe even INSERT or UPDATE it, in which case knowing the original ID can save you a lot of headaches. -----Original Message----- From: dev...@li... [mailto:dev...@li...] On Behalf Of Ed Cottrell Sent: Tuesday, August 19, 2003 9:49 PM To: 'Dev CPP Users' Subject: RE: [Dev-C++] Creating controls based on a database Well, of course it will be in a loop. I just don't know how to create the checkboxes (and other controls) from within the loop, keeping them distinct (non-static). -Ed -----Original Message----- From: dev...@li... [mailto:dev...@li...] On Behalf Of Smurf, Papa Sent: Tuesday, August 19, 2003 11:40 AM To: Ed Cottrell Cc: Dev CPP Users Subject: RE: [Dev-C++] Creating controls based on a database Well this could be handled in a loop or something. Call your function based on CreateWindowEx as many times as there are rows or whatever in a table. The function checks if it must create a checkbox or another control. Does so and places it correctly. Well that is how I would do it. -----Original Message----- From: Ed Cottrell [mailto:em...@ed...] Sent: Tuesday, August 19, 2003 3:36 AM To: 'Smurf, Papa' Subject: RE: [Dev-C++] Creating controls based on a database Yes, but what I'm not sure is how to do an indeterminate number of controls, based on whatever is in the database. Say I pull up 10 rows; it should work the same way if there are 5 or 30. -Ed -----Original Message----- From: Smurf, Papa [mailto:smu...@xs...] Sent: Monday, August 18, 2003 9:29 PM To: Ed Cottrell; 'Dev-Cpp-Users' Subject: RE: [Dev-C++] Creating controls based on a database I'm not 100% sure but I think you should or could use CreateWindowEx (win32 API) to dynamically create any kind of window (control). Look it up in the MSDN lib. -----Original Message----- From: dev...@li... [mailto:dev...@li...]On Behalf Of Ed Cottrell Sent: Tuesday, August 19, 2003 3:17 AM To: 'Dev-Cpp-Users' Subject: RE: [Dev-C++] Creating controls based on a database > That depends on what API or library you wish to use. I'm using the (Microsoft) Win32 API - sorry about that. -Ed -----Original Message----- From: dev...@li... [mailto:dev...@li...] On Behalf Of P.D. van Zelst Sent: Monday, August 18, 2003 6:36 PM To: 'Ed Cottrell'; 'Dev-Cpp-Users' Subject: RE: [Dev-C++] Creating controls based on a database That depends on what API or library you wish to use. If you had specified that up front, people would be able to provide you with samples. -----Original Message----- From: dev...@li... [mailto:dev...@li...] On Behalf Of Ed Cottrell Sent: Monday, August 18, 2003 11:51 PM To: 'Dev-Cpp-Users' Subject: [Dev-C++] Creating controls based on a database Hi all - I have a fairly straightforward requirement: query a database table, then generate checkboxes and labels to correspond to each row, with the checkboxes remaining non-static. For example, if my data consists of names of people, I want to add controls to my form like: [] John Doe [] Suzie Q [] G. W. Bush [] Jacque Chirac ... ([] represents a check box) Assuming I know how to query the database and store the data in an array, how would I use this array to create these controls? Thanks! -Ed ------------------------------------------------------- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01 /01 _______________________________________________ Dev-cpp-users mailing list Dev...@li... TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm https://lists.sourceforge.net/lists/listinfo/dev-cpp-users ------------------------------------------------------- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01 /01 _______________________________________________ Dev-cpp-users mailing list Dev...@li... TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm https://lists.sourceforge.net/lists/listinfo/dev-cpp-users ------------------------------------------------------- This SF.net email is sponsored by Dice.com. Did you know that Dice has over 25,000 tech jobs available today? From careers in IT to Engineering to Tech Sales, Dice has tech jobs from the best hiring companies. http://www.dice.com/index.epl?rel_code=3D104 _______________________________________________ Dev-cpp-users mailing list Dev...@li... TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm https://lists.sourceforge.net/lists/listinfo/dev-cpp-users ------------------------------------------------------- This SF.net email is sponsored by Dice.com. Did you know that Dice has over 25,000 tech jobs available today? From careers in IT to Engineering to Tech Sales, Dice has tech jobs from the best hiring companies. http://www.dice.com/index.epl?rel_code=104 _______________________________________________ Dev-cpp-users mailing list Dev...@li... TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm https://lists.sourceforge.net/lists/listinfo/dev-cpp-users |