zachattack05 70 Posting Pro in Training

Greetings again friends!

It's been a while since I've visited. I had to take a while off from working because of family issues, but things are getting better and I'm starting to work again and that means I get to come back and exchange Q&A with the best programming web group out there!

So...I have a question and was hoping someone might be able to throw a few cents my way.

To clarify, I am not a great GUI designer, I write code, not align things and make it look pretty.

I am writing a customizable dialog box for a library of controls. The window consists of a TableLayoutPanel control with 2 rows and 3 columns all set to "Auto Size" themselves based on content.

The problem I have is, the columns are aligned in auto size mode to the right in a 25%, 25%, 50% type of layout...I need it reversed.

Here's a screen shot from the designer:
Capture10
and here's a screen shot with example text:
Capture12
and the standard message box with the same sample text:
Capture13

Despite the obvious design differences, the buttons are the problem.

I can't set the columns to an exact size since the user is allowed to indicate how many buttons to show, and what the button text will say, so if the user says "show button 1 and make it say 'Click here to blow the entire …

zachattack05 70 Posting Pro in Training

If anyone wants to share who you voted for and your predictions, you can fill my survey out anonymously here: https://docs.google.com/spreadsheet/viewform?formkey=dDBJQlRSWlUyeXdsLXUzNk90MDg5dFE6MQ#gid=0

zachattack05 70 Posting Pro in Training

Wow, excellent point...I have no response to that, but your right! I guess by default that would include the others. Good catch.

zachattack05 70 Posting Pro in Training

I forgot to make the sheet public last night, here's the link to the spreadsheet of answers so far. That shouldn't require you to sign-in or anything.

zachattack05 70 Posting Pro in Training

That's a good point. There are many languages out there that are still used that aren't on the list.

I haven't programmed with half of those languages, I've never had the need to learn them and haven't run into them before (I do have a book on COBOL though oddly enough, but I'm not sure where I got it).

I picked those languages for different reasons, I just inherintly put the languages I personally knew and use(d) on the list and threw in others that I have heard of or seen references to either here on this site or just throughout conversations with others. I didn't pick them for any specific reason other than that. I will say that after reviewing some of the answers, the "languages" that some people have put down as ones they use or have used are quite broad. The next time I create a survey I'll have to be a bit more specific and define a few terms for people. An example, I have seen responses (not just on my survey but others) where HTML is presented as a programming language, CSS is also a "other" language that a respondant listed. These may be considered programming languages by some, but to me HTML and CSS are not programming languages perse, just like I wouldn't consider XML, PHP, and JavaScript to be programming languages. They are text, which is interpreted by another application and executed. To some, that's enough, the browser (or server in the case …

zachattack05 70 Posting Pro in Training

I can share the table data from Google Docs if you are interested, that way you can download it and review the data yourself as well.

I'll do that once I get home (getting ready to leave work now) and I'll post a link as soon as it's marked public.

zachattack05 70 Posting Pro in Training

Good idea mike, I never considered that really. I think I'll do that in the future!

zachattack05 70 Posting Pro in Training

harinath_2007;

You can see a summary of the results of the survey so far here.

zachattack05 70 Posting Pro in Training

I only put 5 countries because it would take ages to type them all by hand, it's not that I don't like your country if it's not listed...I promise! :)

In reality it's just a question that gets general demographics and it isn't something that is all that important to the validity of the survey. Is there a country I should add to the list for future surveys?

zachattack05 70 Posting Pro in Training

Gender is just a generic demographic question. It's anonymous, but once there's enough data you can break stuff down by gender, and say "Males tend to think ______ about language A, while females tend to think ______ about language A." Same with age and location.

It's just something for fun, I love collecting data and analysing results it's fun. Statistics was one of my favourite classes in college.

zachattack05 70 Posting Pro in Training

If anyone is bored and want's to spend a few moment's filling out a survey on programming languages, I am collecting responses on one here.

zachattack05 70 Posting Pro in Training

I must respectfully disagree with rubberman.

While it might take some effort to write a useful algorythm for licensing, you can do it, and you can do it effectively with some practice.

I agree that software which thinks I have an invalid license when I do not would be annoying (although I have never come across software like that, I'm sure it exists). But I do think that having licensing keys or files is a great way to protect your investment. I disagree that it only keeps the honest honest and that most people are happy to pay. Given a choice, I would'nt pay! I do, because I must. Having licensing keys and files keeps the honest honest, but also keeps the low-end, "newbie" tinkerers out as well. Someone thinking about "stealing" software might not if a key is required simply because they don't know a way around it.

This isn't a debate thread though, and I assume sundog1 doesn't care about our opinions on the topic.

I can suggest that you start with reading some books or online articles on these scenarios. A good one I read is here. Now before clicking on the link I must preface it by saying I do not, under any circumstances support software theft in any form. The site the article is hosted on is an anti-piracy site (http://www.licenturion.com/). The link shows an article on one person's investigation into the Windows activation process. Since I read it last there …

Mike Askew commented: Good response, +rep +5
zachattack05 70 Posting Pro in Training

I don't want to give the users permissions they don't need but I either end up having to create a login for the application only and that means storing the username and password on the workstations (either in the app code or in supporting files) or, give each user their own password (which is the current plan) and that password and username is used by the application to do the SQL operations.

I don't know how to get around that.

zachattack05 70 Posting Pro in Training

Not sure.

Could be, but I honestly don't know. That was my best guess.

zachattack05 70 Posting Pro in Training

Of course. The data in the fields is used elsewhere to actually send email. The textbox for entry doesn't accept the spacebar and strips pasted spaces.

zachattack05 70 Posting Pro in Training

The program you installed on the other computer doesnt have ACE OLEDB 12.0.

You can fix it by installing http://www.microsoft.com/en-us/download/details.aspx?id=13255 on the computer you installed your program on.

That should fix it, barring no other odd issues.

Cheers!

zachattack05 70 Posting Pro in Training

rubberman:
Double? That seems excessive to me. The RFC has stated that email addresses can be only 390 characters (inclusive of the @ symbol). Why on earth would I need more than 390 since it would be impossible (unless some rogue server developer ignored the RFC) for an email to exceed that length?

My concern is that Murphy's law hates me, and as soon as I say 255 is pleanty, I'll get a yell down from tech support saying some user can't enter his email address in the field because its too long.

I mean there really is a website at http://thelongestlistofthelongeststuffatthelongestdomainnameatlonglast.com/ and I'm sure someone there has an email address.

I think I'll stick with 390, I just wish there was a standard somewhere for database design that says something like "if you are storing x, you should use y at z length in s situations" but alas...I know of none.

Maybe we should start one!

zachattack05 70 Posting Pro in Training

I've considered that, but dismissed it, maybe prematurely.

The table will constantly be updated by the application with heavy (sometimes with thousands of) inserts in a single operation.

The trigger shouldn't trigger (hehe that's kinda funny sounding) when the application does the inserting.

I need to detect an unauthorized insert, update or deletion and I'm really not sure how this can be accomplished.

It of course would be up to the end users to physically secure their server machine, I can't do anything about that, so I'm not worried about someone using SSMS while sitting at the server box to mess with things, I can't stop that. But I'm concerned about users downloading SSMS (or some other tool) and just connecting directly to the server from their workstation.

Wait a second...flash of genious moment...maybe...what about this:

The table has zero permissions for insert, update or delete with any user (except admins which is a different issue, and really not fixable) and all changes must be performed through the provided stored procedure which would only allow inserts...that would prevent (to some degree, which is better than just detection) updates and deletes. But I don't see how that would prevent unauthorized inserts.

Is there a way for SQL server to know what is sending the commands? Not the user, but kinda like the javascript that detects browser types on the web, so that the server can actively reject any changes unless they come from the application and not "Billy-Bob's SQL Hacking Tool" …

zachattack05 70 Posting Pro in Training

The application I am working on uses SQL to store data. Most of the data is fine the way it is, but one of the tables contains information that would be very tempting for some users to alter.

My original plans were to have the application check the identity column and make sure there are no "breaks" in the sequence to show if a user has deleted a row. But I realized this was a poor choice considering that identity values can be "reset" if so desired and it doesn't address tampering (changing values) in the row.

Is anyone aware of a method that can detect, not necessarily prevent, tampering of a table? I read some other ideas online where a column can contain a hash value based on the row and the row previous to it to detect both removal and alterations. I'm not sure if this is a good solution though and thought I would see if anyone had any ideas.

zachattack05 70 Posting Pro in Training

You need to do it again in ASP then. Some of the code might be reusable to speed it up, but a web server can't run a winforms app in a browser.

Unless your asking something different, you would need to make the application twice.

zachattack05 70 Posting Pro in Training

Just came across this (RFC2821) and in section 4.5.3.1 (Size limits and minimums) it states (emphasis added):

There are several objects that have required minimum/maximum sizes[...]
**local-part**
   *The maximum total length of a user name or other local-part is 64 characters.*

**domain**
   *The maximum total length of a domain name or number is 255 characters.*

This would indicate an email address could be up to 319 characters, not including the @ symbol for a total size of 320.

I've never seen an email address that long, but since it would techincally be acceptable to have one that long, should databases that store email addresses have a field size of 320? I've always used 255 and never had an issue.

Any thoughts?

zachattack05 70 Posting Pro in Training

Hello again everyone!

I've been away for a while, but I've started working again and have a question I am hoping someone might be able to provide some feedback on.

I have a SQL database that has many relationships that utilize surrogate keys. These relationships (some of them) have cascading deletes, but in the SSMS I have been leaving Updates to "No Action." I don't think this is a problem, I never really thought about it, but wouldn't the only time you need cascading updates be if you have natural keys or surrogate keys that are not identities?

I don't even show the PK in the UI, it's not necessary and other than helping SQL, it serves no use to the user.

Thoughts on when you would use cascading updates or am I correct in my assumption?

I appreciate your input as always!

Cheers!

zachattack05 70 Posting Pro in Training

Also who here didn't want to make a game.

I didn't, still don't. :)

But in all seriousness, I did read your post and while I personally would be unable to help as I am working on a proprietary project already, I thought I would give my 2 cents worth.

While I think your idea is noble, and ambitious, I think there are some things that you might not be considering (in no particular order):

Mafia (which correct me if I am wrong is a Facebook/SN game), while I have never actually played, is most likely copyrighted. I suppose a Mafiaesque game is what you are talking about. There are a few issues with game design. I am not speaking from experience (as I have never tried writing a game application other than a Magic 8 ball), but I think one major concern would be that "wanna-be game creaters" are a dime a dozen. Creating a successful game application (as in number of players, not monetary) is very difficult. Since there are so many "wanna-be game creaters" there are just as many games that they created. Competition is high, and other than creating the application for experience in doing so is probably, but not guaranteed to be, fruitless. You could always play it yourself though :)

Another issue is that most of us have full time jobs, either as application developers on some level or with something else, which leaves the project on a "contribute in your spare …

zachattack05 70 Posting Pro in Training

Good points, thanks for the advice! I think I'll go with the disabling option.

zachattack05 70 Posting Pro in Training

I have a listbox that has a context menu that goes with it. The context menu has 3 options on it following the basic "Create new...", "Edit selected..." and "Remove selected..." style.

The rule is that at least one item must be in the listbox at all times, the user can always create new items or edit existing ones, but if there is only one item in the listbox and the context menu opens, should I leave the "Remove selected..." item enabled and just show a messagebox when the user clicks it saying "You can't do this, you have to have at least one item in the list..." or, should I disable the "Remove selected..." item.

The UX Guidebook says to remove (as in hide or completely remove) any interface items, including menu items and tabs in tab views, where the item or items in the tab do not apply in the current context. HOWEVER, if the user expects the item to apply, you should leave the item, disable it, and explain why it is disabled. The example image they show is of a tab view with all the controls disabled and a info box at the bottom saying it doesn't apply.

Since I can't really add a little explanation to the menu item, should I go with a messagebox or should I disable the item? I don't like the idea of removing it in this case.

I'm sure it depends on the scenario, but any general suggestions would be …

zachattack05 70 Posting Pro in Training

I guess that does work, just wasnt sure if there was a setting for that.

Thanks!

zachattack05 70 Posting Pro in Training

Is there a way to set the default properties for a control? Specifically labels so that the margins are all 3 like text boxes?

Any ideas?

zachattack05 70 Posting Pro in Training

UnderlinedLabel I was tired of always looking for a way to underline labels like in Windows property dialogs. I created this little control that allows you to set a two-tone line above, below behind or in front of a label (even through it!) to solve that problem.

The image to the left shows the control with the label text "Connection Preferences" using it's default settings.

To use the control in your project, create a new class file, erase everything in the class file, and paste the code snippet here into that new code file. You can change the namespace if you like and you can omit the copyright comment at the top (it's okay, it's open source to the extreme, I don't care if you take credit for it, it wasn't all that complicated to do).

Some of the features:

Offseting the "Line" by setting the left and right offset properties will shorten the line by x number of pixels starting on either the left or right or both.
Offsetting each line tone by setting Line1 or Line2 offset will move the first or second line up into the label text or above the label text.
Each line can have its own thickness setting as well and it's own color setting.
By default the lines are setup to simulate the 3D horizontal line that you might see online or in an application.

Other possible uses could be a label with no text that …

zachattack05 70 Posting Pro in Training

Hmm. I suppose that's true, but writing Application.ProductVersion will return a string that shows the major, minor, revision and build number in the x.x.x.x format, I just want the first two sets for the executable.

I just assumed since I can write that and get more information than I need, I could just retrieve a small part of it easier.

I understand that there are many versions running at once, but I am just talking about the main executable, nothing else. It's not for anything complex, just for an about box and the title bar of the application.

Thanks for the help and information as always!

zachattack05 70 Posting Pro in Training

I need to retrieve the major and minor version of the application, and instead of instantiating a new Version class with new Version(Application.ProductVersion); is there a static copy of the Version class that already exists? If so, I can't find it, can someone point me in that direction, or is it only possible for me to manipulate the Application.ProductVersion string like above?

zachattack05 70 Posting Pro in Training

Sorry I didn't reply earlier! I'm not getting email notices for articles anymore :(

Anyway, thanks for the help guys! I appreciate it!

zachattack05 70 Posting Pro in Training

I need an array for a method to use to iterate through a string's characters and perform certain operations when one is found or found in certain combinations.

Anyway, to keep things separate and easier to interpret later, I have created an array of characters for the method to iterate through. This is how I have initialized the array:

    private char[] CharArray = new char[]
    {
        char.Parse("+"),
        char.Parse("("),
        char.Parse(")"),
        char.Parse("-"),
        char.Parse(" ")
    };

the array will always be the same, it shouldn't change unless there is an update to the software. Is this okay to do, or is there a better way to do this than parsing a bunch of strings?

zachattack05 70 Posting Pro in Training

It's good to hear that the code could be re-used when in a DLL. Would you say that it is better, then, to completely separate the methods that an application uses and just make the winform application a "shell" of just forms that, by themselves do very little except call methods located in supporting libraries?

That way, since all (or most) of the logic is in the DLLs, very little would have to be re-written, just a new "form" (I guess is what it's called) for the web interface?

zachattack05 70 Posting Pro in Training

I don't work with ASPX or whatever it is now very much at all. I work with WinForms and DLLs most of the time, but I was asked by a client to make a portion of an application available online so that their clients can access certain information without calling them and asking.

So, my question is, since it is a WinForms application, is it possible to place some of the DLLs and/or executables on a ASPX web server and have the pages access the methods in those or will I need to re-write them for the web?

I've seen some web projects contain class files, but I'm not sure if those are being compiled to a DLL or what? I have no idea how ASPX works really other than it's cool to play with.

I'm attending a Microsoft seminar in Creve Coeur Missouri on the first on Cloud Computing and evidently I'll get time in the cloud for free to play around but I'm worried I'm going to waste my free time there since I really don't know what it can do and thought this might be an opportunity to have something to try.

So anyway, back to the original question, can WinForms DLLs and/or executables be accessed on the web? I mean the methods/properties etc, not necessarily the forms themselves.

zachattack05 70 Posting Pro in Training

Hmmm, thats a good point. I don't know why I never thought of that, but that's actually a good idea.

Thanks!

zachattack05 70 Posting Pro in Training

I'm working on a method that will save checkstates to a SQL server and something occured to me and I thought I would ask if there is a simpler way of doing this.

If I have a single parameter, for example an initial checkstate, and an if...else statement is supposed to act on that parameter, is there a way to condense the if statement so I don't have to explicitly show all the possible "or" situations for that parameter?

An example might help. Here's what I have been doing forever which works:

When a parameter has more than 2 possible values (a checkstate has 3, checked, indeterminate and unchecked) I have been doing this for values that I consider equal for whatever reason:

                if (Location.InitialCheckState == CheckState.Checked || Location.InitialCheckState == CheckState.Indeterminate))
                {
                    //do stuff
                }
                else if (Location.InitialCheckState == CheckState.Unchecked)
                {
                    //do more stuff
                }

In the above code, checked and indeterminate should be treated the same, but instead of explicitly stating "Location.InitialCheckState == ..." twice, is it possible to do something like the following (the following code does not compile btw):

                if (Location.InitialCheckState == (CheckState.Checked || CheckState.Indeterminate))
                {
                    //do stuff
                }
                else if (Location.InitialCheckState == CheckState.Unchecked)
                {
                    //do more stuff
                }

I understand that I could use != in the first statement (ie Location.InitialCheckState != CheckState.Unchecked) but if there are multiple options (hundreds) using the != is just as bad.

I've browsed the MSDN articles and never found anything so I'm assuming it cannot be …

zachattack05 70 Posting Pro in Training

skatamatic,

I kinda already have that since I'm using data sets, but one thing that frustrates me is that I don't know how to put xml documentation on the dataset methods so I'm just worried that as the number grows, they will just mesh together and be frustrating and confusing to wade through. I think I might wrap it up in another class that I can "combine" related ones and actually document the methods.

Thanks for the idea! I like it!

zachattack05 70 Posting Pro in Training

So if I have 3 stored procedures that act on a single table (or multiple tables for that matter), is it acceptable to combine them since they are related on some level and then using a switch or if statement to determine which "procedure" to actually run?

As a simplistic example, assume 3 stored procedures, one for creating a record (CreateRecord), one for updating a record (UpdateRecord) and one for deleting a record (DeleteRecord). Can I simply combine them into one procedure called something like RecordManager, or RecordController or whatever, and just have an additional parameter that says which of the 3 to execute?

I know it's actually possible to do this, but I'm asking is it a good idea? Has anyone ever seen this and said "whoever did this was awesome" or "*sigh* Why me?"

I'm always worried about the future and not being able to remember what something is for and I'm not sure if this would help or hurt that worry?

Thoughts?

zachattack05 70 Posting Pro in Training

Hmmm, looping it is! Hehe, if it's standard to do that, then I don't see any point in going out of my way to modify a procedure for something that will probably rarely occur. It's just not worth it.

Thanks for the tip!

zachattack05 70 Posting Pro in Training

I have a checklistbox that I have been working on and I need to commit the changes made to those checkstates to a sql table, removing rows where the checkbox is not checked and adding rows where the checkbox is checked (assuming the checkstate actually changed).

Instead of doing a foreach loop for each item in the checklistbox and if the checkstate changed, executing a sql statement, is it possible to pass other objects to sql and have it act on that object? Like a DataTable or something that is serialized or something that I can pass to a sproc?

I don't necessarily mind using the loop and honestly it's not a screen people would be using much so I doubt it would cause much network traffic anyway, but who knows...I'd rather do it right the first time than to have it cause problems later and not understanding why.

Any suggestions?

zachattack05 70 Posting Pro in Training

Got it!

I added this code to my control's MouseClick event. It probably needs some cleaning up, but it works perfectly:

    private void MyCustomCheckedListBox_MouseClick(object sender, MouseEventArgs e)
    {
        // Uncomment the lines below to draw a blue box around the checkbox margain. This is useful if you want to change the click area, by providing a 
        // graphical representation of the area.
        //Pen MyPen = new Pen(Color.Blue);
        //MyPen.Width = 1;

        //CreateGraphics().DrawRectangle(MyPen, 0, 0, 15, Height);

        //MyPen.Dispose();

        // If CheckOnClick is true, just return otherwise once an item's checkbox is clicked, the check is immediately reversed.
        if (CheckOnClick)
        {
            return;
        }

        // If the selected item hasn't changed, just return otherwise once an item's checkbox is clicked, the check is immediately reversed.
        if (SelectedIndex == LastSelection)
        {
            return;
        }

        // The last item selected.
        LastSelection = SelectedIndex;

        // Only toggle item checks if the left button is clicked.
        if (e.Button == System.Windows.Forms.MouseButtons.Left)
        {
            // Only toggle item checks if the left-click was within the margin of the checkbox (15px)
            if (e.X <= 15)
            {
                // Reverse whatever check state is currently set.
                switch (GetItemCheckState(SelectedIndex))
                {
                    case CheckState.Checked:
                        SetItemCheckState(SelectedIndex, CheckState.Unchecked);
                        break;
                    case CheckState.Indeterminate:
                        SetItemCheckState(SelectedIndex, CheckState.Checked);
                        break;
                    case CheckState.Unchecked:
                        SetItemCheckState(SelectedIndex, CheckState.Checked);
                        break;
                }                   
            }
        }
    }
zachattack05 70 Posting Pro in Training

Hey that's a good idea!

I think I'll do that!

zachattack05 70 Posting Pro in Training

thines01,

If i set it to false, then when the user clicks the checkbox of a non-selected item, it just selects the item and does not check it. The user has to click twice to check the items in the list and if you are checking 5 things in a row that's 10 clicks, and while it's not much, I can see it being an annoyance.

skatamatic,

I think you might be right, but I'm not sure yet, I'm determined to figure this one out. If I do I'll post it up as a code snippet, it boggles my mind that this isn't a standard option, but meh, it's okay, I like the challenges :)

zachattack05 70 Posting Pro in Training

thines01,

No that's a different issue, this one involves if an item is checked, a stack object must be updated with some data, and I would like to make sure that the stack is updated BEFORE any user code is executed.

Order example:

  1. User checks item
  2. ItemCheck event is triggered
    A. Since both the control itself and the user using the control subscribe to the ItemCheck event, I would like to make sure the order is as follows:
  3. Stack is updated with data
  4. User event code is executed

If 3 and 4 are reversed, and the user code needs to access the information in that stack, they could be provided with incorrect data.

Also, when I say "user" I mean the programmer using the control on a form, not a end-user of the software product.

zachattack05 70 Posting Pro in Training

If I do that, then the user can just click the text to check it. I want to prevent that. I'm trying to get it so if the user clicks the text itself nothing happens except the item becomes highlighted but if the user clicks the checkbox of a non-highlighted item, it will check it and highlight it. If I have CheckOnClick to true, then it's too easy for someone to accidentally check something and having to click each item twice is not all that efficient.

The way I look at it is:

  1. If the user clicks the text, they intend to highlight/select that item, not necessarily check it.
  2. If the user clicks the text, or checkbox of a highlighted/selected item, they intend to check that item.
  3. If the user clicks the checkbox and not the text, regardless of if the item is highlighted/selected, they intend to check that item.

If I set CheckOnClick to true, everything is checked, no matter where they click.

But if there was a way for me to know if the checkbox portion of the item was clicked, I can mark that one as checked myself. Does that make sense?

zachattack05 70 Posting Pro in Training

Is this possible?

I am trying to modify how the CheckListBox works when a user clicks on an item. By default there are two options. One requires the user to "select" the item first and then they can check it, meaning 2 clicks. The other is they click the item and it checks that item.

I'd like to combine the two, so that if a user clicks the text of the item it highlights it and "selects" it, and if they click it again it will check it. But I also would like it so that if a user clicks the checkbox it will select the item and check it at the same time.

I'm guessing here, but I think I would need to override the OnSelectedIndexChanged method and find out if the user clicked the text part of the item or the checkbox part.

Any ideas or suggestions would be appreciated!

zachattack05 70 Posting Pro in Training

I tried that, and it always triggers in the same order, but I'm worried that it could just be a coincidence since they are supposed to execute synchrously.

zachattack05 70 Posting Pro in Training

So I'm working on this CheckListBox and would like to override the Add() method which adds a new item to the checklistbox, but, the method is not a CheckListBox method, it's a method in the CheckListBox's ObjectCollection.

So, two questions:

  1. Can this method be overriden from within a control that inherits directly from CheckListBox?
  2. Is it possible to completely override the collection the CheckListBox accepts so that I can handle the adding and removing from the list directly. As in, instead of my custom control using CheckListBox.ObjectCollection for items, can it use MyCheckListBox.MyCustomCollection class that inherits from ObjectCollection? If so, I'm not sure how to change that in the control.

I would really appreciate any suggestions on this. I am attempting to add values to the items that depend on the state of the item's check value, and instead of maintaining multiple dictionaries/lists, it would be nice to just use one, each item stands alone with each value stored in its respective class object MyCustomItem or something that would go in the MyCustomCollection.

Any ideas?

zachattack05 70 Posting Pro in Training

I have a custom control that derives directly from CheckedListBox. If the CheckedListBox subscribes to its own event (ItemCheck for example) and the user of the control also subscribes to it, does the control's event trigger first before the user's?

I read on MSDN that if multiple subscribers subscribe to an event, they are triggered synchronously, but I wasn't sure if that applied in this situation or not. I understand if there are multiple handlers for one event, but not sure about this one, if the event handlers occured synchronously on the control first and THEN the user's events are triggered synchronously.

Any ideas? I've tested it (kinda) with messageboxes and they always seem to trigger in the same order (but that doesn't mean it always will) with the control's event triggering first, and the form's event handlers triggering afterwards.

zachattack05 70 Posting Pro in Training

Momerath,

Yeah I use namespaces to organize as well. I actually have changed the name to just CheckListBox for now, but I like your idea, I just hate objects with long names, and crazy long namespaces and to me DataboundCheckListBox is on the edge of being too long for me to stand. Probably something I need to get over.

I think as far as deriving from UserControl or the actual control itself, I have it set-up to derive from UserControl now, and I think I'm actually going to keep it like that just to hide the inherited CheckListBox properties that, if are filled in at design time could cause the control to screw up. I'd rather have my custom properties take care of those. I'm aware you can hide the properties by overriding them and/or marking them as not browsable, but this covers it :)

Thanks for the feedback! I really do appreciate it!