-
Aug 14th, 2015, 02:39 PM
#1
Thread Starter
Lively Member
Classes -- Project message boxes
Hi guys
I'm trying to improve my class-making skills... so humor me if you think this is the wrong approach. I have a project that uses several message boxes. Currently, i have these message boxes written into modules and have duplicate instances dotted around. What i want to do is write a class or set of classes that will make my project more efficients and easier to maintain - essentially one message box class (or set of classes) which would replace all my seperate module-level instances.
Ok so a typical message box comprises (excuse the terminology) the body of text, the title, the click type (ie OK, yes/no, etc), and the alert message (ie 'Warning!', 'Question', etc.).
Within my project, lets say i use the following text as the body:
"This is the end of the list"
"This is the start of the list"
i have the following titles:
"Ooops!"
"Argh!"
I use the following click types:
OK
Yes/No
And finally, the following alerts:
Warning!
Stop!
Could anyone give me an example of a class/classes that would alow me to call the desired message box from a module based on the combination in need?
Please give me a shout if i'm not making sense - any and all help appreciated.
-
Aug 14th, 2015, 03:06 PM
#2
Hyperactive Member
Re: Classes -- Project message boxes
Not sure why this is necessary, unless I'm not getting the gist. Unless you're looking for the ability to name specific text boxes (text, title, and buttons) and call them using the name. Then it's a simple enum type passed into a function that does the proper call to MessageBox. I'm not seeing the need for a class at all, here... at most a single function Am I misunderstanding? Unless you want a class containing various functions, CallEndOfListTextbox(), CallStartofListTextbox(), CallADifferentTextbox(), CallAnotherDifferentTextBox(), and so forth. Yeah, you can do that, but I fail to see what it buys you over a simpler and more standard approach.
-
Aug 14th, 2015, 03:13 PM
#3
Thread Starter
Lively Member
Re: Classes -- Project message boxes
Originally Posted by HongKongCV
Not sure why this is necessary, unless I'm not getting the gist. Unless you're looking for the ability to name specific text boxes (text, title, and buttons) and call them using the name. Then it's a simple enum type passed into a function that does the proper call to MessageBox. I'm not seeing the need for a class at all, here... at most a single function Am I misunderstanding? Unless you want a class containing various functions, CallEndOfListTextbox(), CallStartofListTextbox(), CallADifferentTextbox(), CallAnotherDifferentTextBox(), and so forth. Yeah, you can do that, but I fail to see what it buys you over a simpler and more standard approach.
Like most of my questions... this is down to inexperience - so thanks for your input . I'll look into using enums.
-
Aug 14th, 2015, 03:09 PM
#4
Re: Classes -- Project message boxes
This feels suspiciously like a homework definition? There happens to be a MessageBox class already defined. Perhaps you should look at it for inspiration?
This answer is wrong. You should be using TableAdapter and Dictionaries instead.
-
Aug 14th, 2015, 03:14 PM
#5
Thread Starter
Lively Member
Re: Classes -- Project message boxes
Originally Posted by Sitten Spynne
This feels suspiciously like a homework definition? There happens to be a MessageBox class already defined. Perhaps you should look at it for inspiration?
Not very helpful... but thanks anyway.
-
Aug 14th, 2015, 04:31 PM
#6
Re: Classes -- Project message boxes
Originally Posted by GTDriver
Not very helpful... but thanks anyway.
Then be more specific? Did you take a good look? It's a class that seems to do everything you asked about, and if you piggyback its design you'd be close to implementing it yourself. What is lacking?
This answer is wrong. You should be using TableAdapter and Dictionaries instead.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|