Jump to content
Xtreme .Net Talk

rbulph

Avatar/Signature
  • Posts

    398
  • Joined

  • Last visited

Everything posted by rbulph

  1. How can I find all classes that inherit from another? The object browser has an item on the menu called "Show Derived Types" which you can check, but this doesn't work as I would expect. For instance a search for TypeConverter with this checked does not find ExpandableObjectConverter which inherits from this.
  2. OK thanks, I think that answers it.
  3. Is there any practical difference between the two procedures in the following class? Public Class Class1 Inherits PictureBox Protected Overrides Sub OnMouseMove(ByVal e As System.Windows.Forms.MouseEventArgs) If TypeOf Me.Parent Is Form Then Me.Parent.Text = e.X MyBase.OnMouseMove(e) End Sub Protected Sub Class1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseMove If TypeOf Me.Parent Is Form Then Me.Parent.Text = e.X End Sub End Class I suppose the second sub could be Private or Public as well so, in the latter case, it could be called from outside. But is there anything more?
  4. rbulph

    Law

    You can set up a company if you wish. It will cost probably £200 to buy and you'll have a certain amount of ongoing obligations in regard to it such as filing an annual return for which there is a fee of £15. You'll need at least two directors. If you do set up a company your company can have a trading name which is different from its registed name if you wish, and you can trade under that. If you don't set up a company you would be acting as a sole trader, but again you could have a trading name if you wished for your business, you don't have to do business under your own name. But any contracts will have to be in your own name. As you probably know a company is a legal person in its own right. But is has limited liability so if someone were to have a complaint about the software, and sue you, it would have to sue the company if the company had sold the software to them. Your own personal assets would (generally) be safe from enforcement of any judgment obtained. If you have a company you can withdraw any profits (i) by paying yourself a salary, (ii) by paying yourself dividends or (iii) indirectly by selling the company. There are tax consequences to all of these. As for copyright, your code is copyright without any registration. And things such as the visual design of your program would be copyright. But the actual idea of it will not be copyright. For a lot of "inventions" you can get a patent which allows the inventor to stop anyone else from copying the invention for a certain number of years. In the UK a computer programme is not considered to be an invention; in the US I believe it often is. Hope that helps.
  5. I'd like to customise the property grid so as to do things such as be able to change the description of a property at run time, and set the order in which properties appear to not be the default alphabetical order. I understand that the solution lies in classes such as ICustomTypeDescriptor, PropertyDescriptor and TypeDescriptorProvider. But I can't for the life of me figure out what you have to do with these classes. Can anyone point me to some good documentation on this?
  6. What's the need for the Component class? It only has a handful of properties and methods. Why couldn't you just have the Control class? Can you give me an example of the use of a Component which is not a Control?
  7. I did a search for ICustomTypeDescriptor only to be told that no results were found and that (presumably this was the reason) ICustomTypeDescriptor had been excluded from the search because it was either too short, too long or too common. Presumably it was too long. Isn't it a bit silly that there's an exclusion for words which are too long?
  8. How could I copy the contents of a propertygrid to the clipboard so that the user can paste them to Excel or wherever? It seems a simple enough thing to want to do, but I can't figure it out at all.
  9. Not that can be accessed from the code that is called on the Paint event.
  10. Normally if there's an error in my code the debugger stops at that error and tells me about it. But a recent null reference error in a sub called from the Paint event of a Picture box did not cause the debugger to stop execution but to abort the drawing and colour the picturebox white with a red border and red diagonal lines. The following message appeared in the Immediate Window: "A first chance exception of type 'System.NullReferenceException' occurred in Res Ipsa.exe" This really threw me as I originally thought that somehow I was drawing this pattern. But anyway does anyone know why it did this rather than stop execution in the normal way?
  11. I don't like the fact that Vis Studio saves quite a lot of files under My Documents\Visual Studio 2005. This isn't the sort of thing I want to keep there. So I've changed all relevant settings that I can find under Tools/Options that referred to this to "C:\Visual Studio 2005" and copied everything over to the root directory. But I'm still getting the "My Documents\Visual Studio "folder created automatically by Vis Studio, with a sub-folder called "Back-Up". How do I prevent this?
  12. rbulph

    Plug-ins

  13. rbulph

    Plug-ins

    Probably, but then I won't be able to create the object that's needed, so as long as I trap the error, it's not really a problem.
  14. rbulph

    Plug-ins

    I'm wondering if the simplest way to deal with this might be to trust serialization to do it for me. If I create an instance of the object and serialize it, I can then get it back with serialization. The serialization engine (if there is such a thing) will surely deal with any versioning issues for me.
  15. rbulph

    Plug-ins

    Yes, I'm thinking about how to store the choice between uses of the application. It's actually a choice of a particular object within a plug-in that I want to store. My concern is that a plug-in could be superseded by a different version. The names of the plug-in and of the object might change, but the CLSID (if .net has these) might be more durable. So wouldn't that be better to store than the fully qualified name, and if so, how do I get hold of it?
  16. rbulph

    Plug-ins

    Given a set of objects implementing a particular interface, what's the best way to store a user's choice of object from that set between sessions?
  17. I've got a problem with password protecting a file. When I use serialization to store the password with the other details of the file, anyone can then open the file with a text editor and the password is right in front of them. So I suppose I have to encode the password before saving it with the file and decode it when opening the file. Does VB provide any support for doing this or will I have to make up an algorithm myself?
  18. OK, thanks. I'll do this separately from the dialog box then.
  19. I'd like to add a button to the toolstrip in the Save File Dialog, to deal with password protection of files. For the print preview dialog I could do this quite easily by getting a reference to the toolstrip through the Controls property of the dialog. But there is no Controls property of the Save File Dialog. How would I go about this?
  20. Thanks. I don't want to do a screen capture because it will require me to show real controls somewhere on screen presumably. I don't actually need the display capabilities of the richtextbox for the purposes of the sample, so I'll just substitute an ordinary textbox to get this done.
  21. DrawToBitmap doesn't work for rich text boxes unfortunately, and this is one of the types of control I was hoping to do this for. If you try, you don't get any errors, but just a greyed out, empty box is drawn.
  22. Not bad. But this doesn't have any methods to draw combo boxes or textboxes. Presumably I have to build these up with a combination of the other methods? Bit of a bore.
×
×
  • Create New...