Jump to content
Xtreme .Net Talk

divil

*Gurus*
  • Posts

    3026
  • Joined

  • Last visited

Everything posted by divil

  1. Not that I know of - not a managed way, at least. I'm sure you could intercept the WM_NCPAINT message and do some processing to get the metrics/bounds of the menu and draw on it though.
  2. You'll have to owner draw the treeview, which the framework does not provide a managed wrapper around. A reference for the messages and structures involved in doing this is part of MSDN, under the user interface/common controls reference section.
  3. You can put anything that derives from Control in there, including forms (if their TopLevel property is set to false). I don't see why you'd want to put a form in there though, any old container control would do. You could design a usercontrol and host one of those in there.
  4. Which is why you shouldn't be opening it in that function either. The Open and Close of it should really be in the same scope, you could always pass the connection object to that function which could return the datareader from it.
  5. The minimize, maximize and close buttons for MDI children are supposed to be there, it's not a bug. I'm not sure what you mean about the ComboBox thing, I've never had such an issue. If you can reproduce the bug, you should consider sending it to MS. If you want to implement tabbed documents like Visual Studio, there's a control I wrote on my site that can do it, check the url in my signature.
  6. Are you running this method repeatedly? The way you have implemented it could be done better - the code to open (and close, which you don't have) the connection should surround any code that uses the data reader. It is probably trying to create a new connection every time because the existing one is busy with the datareader, maybe you're not closing that either? You should always call .Close() and .Dispose() on objects that support them when you're done with them.
  7. Png files should work fine in GDI+ (and yes, they have full transparency information) as long as they're never added to an ImageList. This corrupts their alpha channel. Have you experimented with drawing them to a graphics surface using DrawImage() in the Paint event of a control?
  8. Take a look at the ControlPaint class. It has a DrawGrid method which will probably be a lot faster.
  9. Yes, it's possible. You're going to have to break your requirement down in to individual problems before you get much help, though. To start you off, you can use a TcpListener class (amongst other things) to listen for connections on a specific port. Consult the documentation for more info and examples.
  10. Use the AddHandler statement to assign a method in your code to an event on a control created at runtime. If you look AddHandler up in the help there should be an example.
  11. No, that's using the common controls ActiveX control, which you should never do. You're right that the Windows Forms progressbar class lacks a way to achieve this effect. If you really want it, I suggest you derive your own class from ProgressBar, override the CreateParams property and add the PBS_SMOOTH constant to the window styles.
  12. Ignore them? It reads them in just fine, were you expecting it to do something else?
  13. Managed code can quite easily be faster than unmanaged code, I proved this in another thread a few weeks ago. C# code that just iterates over a loop and increments a counter always beat its C counterpart. The next release of .NET has a managed class to play sounds.
  14. The ShellExecute API is partly what the Process class wraps - you can pass the "print" open action to a file using it.
  15. Generally the best way of doing this is to alter the constructor of Form2 so that it accepts an instance of Form1 as a parameter, and then you can store it in the variable you've already declared.
  16. No, you don't get the MSComm control with Visual Studio .NET. Just because the one on the Microsoft is "a lot of code" doesn't mean it's not good.
  17. If you're already drawing it yourself, presumably you can keep an integer field in the control of an item to draw specially - i.e., to draw a line underneath. When you need to display such a line you could then set the field and call Invalidate() on the control.
  18. You have to use interop to create a hatched brush that looks like the one the splitter uses - if this is what you're trying to do, I have some C# code from my dockable windows suite that you can have, if you like.
  19. Unfortunately there is no built-in support for RS232 communications in .NET 1.1. There will be support in the next version, whether or not that will extend to the compact framework I have no idea.
  20. Use Windows Update.
  21. Windows just doesn't support truly transparent (or translucent) controls, only top-level windows. For an interface like this, you should be doing all the drawing yourself in the form's Paint event, anyway - using controls for all the UI elements is a little wasteful and as you have discovered, quite restrictive graphically.
  22. You won't get a .NET Windows Forms Control on to a VB6 form.
  23. myTimer.Enabled = False
  24. Go to the usual Add Reference dialog, then select the Project tab at the top.
×
×
  • Create New...