Search results for query: *

  • Users: mbb
  • Order by date
  1. M

    Retaining the Checkedstate of a listbox even after the form is reloaded

    Why not create your listbox outside of the form and pass through on a parameter, or set as a property? Even if the form disposed, the listbox will continue to exist, including its current state. If you are not comfortable in using a control in that way, then another way is to keep track of the...
  2. M

    Question problem with datatype

    I think you should consider restricting the value that is entered into the cell prior to anything else happening, to ensure that the value entered can be converted into a type you expect. In this case an integer value, since that is the parameter's type. You can use the Int32.TryParse() method...
  3. M

    nightly count out?

    Are you having trouble with conversions? You might try the Convert class and String.Format.
  4. M

    Question How do I copy one file in to multiple folders?

    If there is something specific that can identify as user name then use regular expressions: Regex.Replace("subject", "regex", "replacement") Search ".net regular expressions" and you'll find plenty of reference material. You can assume a certain format in the path e.g. c:\.*\.*\UserName\.*...
  5. M

    Some Advice on Using Expression Trees.

    Sorry. My intentions weren't very clear. The the filter will be dynamic depending upon what a user selects in a UI or whether a filter is available at all, depending upon the screen the collection is being used in. So my code may look something like this: if isActiveFilterA and...
  6. M

    Some Advice on Using Expression Trees.

    I am considering writing some code that will allow a generic filter, or where part to be applied to a collection. After a little research, it seems I will have to build an expression tree, compile it and pass the result into the where function of a collection etc. The example I have simply...
  7. M

    Simple question 'the correct way!'

    I agree. This is an important point. Make your code only as complex as it needs to be.
  8. M

    Controls changing size for no reason

    Do you have a menu or status strip on your form? Its not actually part of the form but a control that takes up space on the form. I've had an issue like this where the form resizes controls to take into account the menu or status strip being shown or hidden, IIRC. I sorted this out by...
  9. M

    VB Forms, is MDI what I need?

    Using a panel as a "form", can be quite effective. I'm using this now. To avoid clutter in the designer, I am putting the panel's location to 1000,1000 and set it to 12,10 if I want to do something with the controls. I then have a control object for each panel or screen which manages where...
  10. M

    Question Implementing Singleton in Parent Class

    Your understanding of what is a singleton doesn't seem right to me. If you have a parent object that instantiates multiple children objects, and the children have to reference the parent, then pass the parent's object into the childs constructor. Something like below where your application's...
  11. M

    New Form not recognized in intellisense

    Be sure to add the project or library the form resides in (the assembly) to the references of your project if it is not in the same project as the rest of your code.
  12. M

    I want to make some kind of database app!

    A very simple, but unsecure way of storing objects on disk is to serialise them. You could represent the fields captured in an object and then represent the table as a collection of those objects e.g. arraylist or dictionary. Then you can serialise the collection object to disk. Deserialise...
  13. M

    Question Point Of Service

    What about posting the C# example ....
  14. M

    Sync Locks

    Thanks, this is exactly what I needed to know. I can use the sync lock to protect all critical operations on the collection then and I'll try very hard not to deadlock. ;)
  15. M

    Sync Locks

    Hello, I am considering a piece of code that will manage access to a collection object from multiple threads - add, update, remove, clear. OK ... so I have put a sync lock within each method, but what is not clear from the MS documentation is exactly how the sync lock is behaving. Is it...
  16. M

    Break a string into two strings

    Using fixed width fonts might help simplify the problem too.
  17. M

    Add Controls dynamically and display information in them on windows form

    Have you considered using a datagridview? It will allow you to dynamically add or remove rows depending on how many customers you have. The control allows columns to use things like combos and images.
  18. M

    MDI Form

    Well, I'm eating my furry hat now! This was good advice in the end. Using disjointed forms just looks bad so now I am using mulitple panels as 'screens', each with its own controller object that manages appearance, location and binds event handlers onto named controls. The main winform looks...
  19. M

    MDI Form

    Panels would be the way to go, but as I have said I want to avoid having to write a presentation engine. I'll stick to using non-MDI forms for now and see how it goes. Also, from what you say, it follows that there may be a custom MDI control out there that behaves as a pre-NET MDI would too...
  20. M

    MDI Form

    If your going to suggest that I use the progress bar on a status menu, then forget it. It's not what I had in mind. I'm exploring alternative options now. I have been toying with the idea of using floating panels to show status or a menu (when I say menu read a datagridview configured to...
Back
Top