Click to See Complete Forum and Search --> : Excel style Edit Controls - advice please


SIBUK
January 22nd, 2008, 08:08 AM
Hello! I was wondering if someone could maybe give me some advice. Does anyone know how the 'Cells' work in Microsoft Excel? Are they just a massive array of thousands of Edit Controls, each one individually created using CreateWindowEx when the application launches?

The reason I ask is because I am making an application which needs to (depending on what the user selects) generate a page full of Edit Controls which contain various information such as names, addresses, dates etc. The user then needs to be able to edit things as they see fit, save the data and then print it all off. In essence, just like an Excel spreadsheet.

But, im not really sure how Im going to do it. So far the only way I can think of is to procedurally generate a whole bunch of edit controls and lay them all out nicely like in an Excel spreadsheet. They need to be procedurally generated because there will be a different number of them each time so its not like I can use the Resources editer in VC++ to lay them all out ready.

Does anybody have any ideas on the best way of going about doing this, or can give any indication of how it is done in Excel?

Tom Frohman
January 22nd, 2008, 08:23 AM
There are a multitude of Grid controls you could use.

For example:
Grid Control (http://www.codeproject.com/KB/miscctrl/gridctrl.aspx)


Tom

SIBUK
January 23rd, 2008, 06:37 AM
Tom Frohman, yesterday after I read your reply I took at look at that Grid Control and it is exactly what I need. I cursed that fact that it was MFC for a while and after a futile search for a WIN32 grid control that was even half as good as that one I decided to once and for all learn MFC. So I spent all yesterday reading tutorials and converting my project over to MFC.

I have now got the grid control in my new MFC application and its all working nicely, and I have to say I am rather impressed with MFC actually :S I'm glad I learnt pure API first though.

Thank you for your help! This has no doubt saved me a LOT of time :D

fred100
January 23rd, 2008, 09:00 AM
and after a futile search for a WIN32 grid control that was even half as good as that one I decided to once and for all learn MFC.

Win32 has plenty of native grid controls 10 times better than this one
(especially to connect to databases...)

SIBUK
January 23rd, 2008, 10:01 AM
fred100 o.O any chance you could link me with a few examples?