Jump to content
Xtreme .Net Talk

divil

*Gurus*
  • Posts

    3026
  • Joined

  • Last visited

Everything posted by divil

  1. I don't know why you'd get that error. You never told me if the image you're trying to draw fast is a large one. This is almost definitely why it's slower than its C++ counterpart, since it's using GDI+.
  2. They require the .NET framework sdk be installed.
  3. Put this code at the top of your form: using System.Runtime.InteropServices; Then use the following code to make the form draggable by clicking on it anywhere: [DllImportAttribute("user32.dll", CharSet=CharSet.Auto)] public static extern IntPtr SendMessage(IntPtr hWnd, int msg, int wParam, int lParam); [DllImportAttribute("user32.dll", ExactSpelling=true, CharSet=CharSet.Auto)] public static extern int ReleaseCapture(); const int WM_NCLBUTTONDOWN = 0xA1; const int HTCAPTION = 2; private void Form1_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e) { ReleaseCapture(); SendMessage(Handle, WM_NCLBUTTONDOWN, HTCAPTION, 0); }
  4. I've never encountered this behaviour when referencing a control library that's compiled in to a DLL. When I'm developing controls I have one solution with both the control library and a test project, and the designer automatically puts the control library in the toolbox. However, this isn't compiled on disk, instead it's referencing the dynamically compiled version kept in memory by Visual Studio. Occasionally it can forget to update this and I have to close the test project form and re-open it.
  5. Everything derives from object, therefore there will be no problem with passing anything to an argument that is of that type, whether Option Strict is on or off. If you got an error, it was probably something else.
  6. I don't know of any .net sample code, but Steve from vbAccelerator has code posted in vb6, called appbar class I think, that allows you to register your form as reducing desktop space like you want to do.
  7. How is your SendMessage function declared? And yes, you should be using .ToInt32, not .ToString on the lParam.
  8. I've used colormatrix instances to fade images quite a lot, without finding it slow. However, I've only ever used quite small images and I could believe that large images would be significantly slower. Remember, GDI+ is not hardware accelerated. One thing you could try is not bothering with all those float values; if you just use the parameterless constructor for ColorMatrix and set its Matrix33 property to the alpha multiplier that will do the same.
  9. You cannot create ActiveX controls with vb.net. You can create windows forms control libraries, and they will always compile to dll files. With a lot of work you can get a windows forms control exposed as an ActiveX control, but I don't know of anyone getting one to work property on a VB6 form.
  10. l was referring to the LParam passed to your code. You should be doing this: Case WM_LBUTTONDOWN x = uMsg.LParam Mod 65536 y = uMsg.LParam \ 65536
  11. divil

    icons

    You can copy and paste in to it.
  12. Try applying a LayoutKind attribute, with Sequential, on the structures.
  13. The x coordinate will be l Mod 65536, the y coordinate will be l \ 65536.
  14. The trend for .NET downloadable programs is to just point the user to the Microsoft download page for the runtimes. There is no broken down version, only the whole lot, which is 24MB for the latest.
  15. The best thing for a beginner to do is buy a book. There are loads on beginning with C#, try a Wrox one.
  16. Are you saying that the defaultvalue attribute you applied isn't working? I usually just use the constructor overload that accepts only a string but from looking at yours it should work - the default value in the propertygrid should be "C". You realise that attribute applies only to the propertygrid I take it? You still have to initialize the variable either in your constructor or on the declaration before the behaviour will be as you would expect.
  17. You might find VolteFace's code here useful, it illustrates dynamically attaching event handlers and even painting menus like you're doing.
  18. I honestly have no idea. I can only imagine it's a bug, that's why it's fixed in version 1.1. You might be able to instantiate the class under 1.0 via reflection.
  19. divil

    compiling

    .NET projects are compiled to an EXE every time you run them, they're not interpreted like VB6 was.
  20. With difficulty :P Hence the popularity of RAD languages.
  21. You can't. If you want a development environment to compile code for .NET 1.1 you need Visual Studio .NET 2003.
  22. divil

    icons

    Visual Studio includes excellent icon editing capabilities.
  23. If you ever need to have a smaller critical section where you want to lock access to one object, you can use the VB.NET Synclock block.
  24. You must read the whole file in, change the line and then write the whole file out again. If this could cause memory problems, you can always write out the new file as you're reading the old one in on the fly. Either way, there's no way of directly replacing a line in a file.
  25. If you've been programming such applications for 7 years I would expect at least £25k as a bare minimum.
×
×
  • Create New...