Denaes Posted August 12, 2004 Posted August 12, 2004 I'm not talking methods or properties, but in effeciency. Just like you shouldn't make a tetris game using 1,000 pictureboxes, apparently some controls are created for a reason. In fact, what can the label do that the textbox cannot already do? So there must be a good reason why it's the preferred control for displaying text. I'm into this because in the MCAD book it's showing you how to properly use controls and in this example, it's using textboxes setting their ReadOnly property to True to display 11 different results. Why? I'm not sure that it's "wrong", but is it really the best practices MS should be teaching? wouldn't it be more resource effecient to use labels set with a 3d border and change their backcolor to look like textboxes if that's what you wanted? Quote
Administrators PlausiblyDamp Posted August 12, 2004 Administrators Posted August 12, 2004 Generally speaking if the text is to be readonly and just for display purposes (i.e. no need to copy either) then labels would seem the obvious choice. If you may need to select the text or there could be a requirement for the data to be edited then use a textbox. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
neodammer Posted August 12, 2004 Posted August 12, 2004 I would assume labels use more resources than textbox's. Textbox's also resemble what alot of people are used to in terms of "forms" etc... In theory I believe they are the same just easier for people to use. Quote Enzin Research and Development
Denaes Posted August 12, 2004 Author Posted August 12, 2004 I would assume labels use more resources than textbox's. Textbox's also resemble what alot of people are used to in terms of "forms" etc... In theory I believe they are the same just easier for people to use. I think it would be the opposite. Labels just display text. Textboxes display, allow you to select, input, type, multiline collections, etc. Quote
neodammer Posted August 12, 2004 Posted August 12, 2004 yeah i got to thinking that myself, yeah probably the opposite. Quote Enzin Research and Development
*Experts* Nerseus Posted August 12, 2004 *Experts* Posted August 12, 2004 In the past, a label wasn't a true control - they didn't have window handles for example. In Windows terms, a label *used* to be just something the compiler drew for you. But now that labels have window handles, I assume they're a lot more "intense" than they used to be. Meaning, they're taking up GDI resources (window handles). In general, a textbox would probably be handling a lot more windows messages as well, even if YOUR code doesn't use them. I wouldn't let that sway you too much. In general think of it like this "if I can use a label, use a label". Only if the label doesn't give you what you want should you use the textbox. -ner Quote "I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
Denaes Posted August 12, 2004 Author Posted August 12, 2004 I wouldn't let that sway you too much. In general think of it like this "if I can use a label, use a label". Only if the label doesn't give you what you want should you use the textbox. -ner Thats what I figure. MCAD book is making the GUI for a Doughnut Shop. I'm not sure if it builds on this and eventually uses them as a textbox or not. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.