Jump to content
Xtreme .Net Talk

divil

*Gurus*
  • Posts

    3026
  • Joined

  • Last visited

Everything posted by divil

  1. You'll either have to write a control from scratch, or owner draw the treeview to provide this behaviour. Either way it's going to be a great deal of work. You should be able to add controls to a TreeView, but providing the layout and visibility logic will be quite difficult. There is an example of owner drawing a treeview (in this case to provide multi-select functionality) somewhere on the windowsforms.net site.
  2. Here are directions for embedding a resource such as this in your assembly: 1) Right-click on your project, go to Add, then Existing Item. Select the image file and it will be added to your project tree. 2) Highlight the newly added file, and in the property grid change its BuildAction to Embedded Resource. 3) (VB) Make a note of your root namespace, set in the project options. You'll need to specify this when extracting the image at runtime. (C#) Make a note of the default namespace for your project, found in project options. If you place the resource in a subfolder on your project tree you will have to specify that as well. 4) In code, use the following to get the image: Dim b As Bitmap b = New Bitmap(System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("MyRootNamespace.logo.jpg")) Bitmap b; b = new Bitmap(System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("MyDefaultNamespace.logo.jpg")); 5) You can now do what you like to it, including assigning it to a picturebox - myPictureBox.Image = b
  3. You could do that with the registry, if you put the key under HKEY_CURRENT_USER. Or, you can get the complete path to the user's startup directory in the start menu using: Environment.GetFolderPath(Environment.SpecialFolder.Startup) I'm not sure how you'd create a shortcut there using .NET though.
  4. You could establish a socket class and manually send a HEAD request for the page to the webserver, that would do it, without having to download all the content on the page. The easier method would be to use WebClient to download the whole page and catch an exception if the page wasn't found. This would be slower.
  5. I really don't know, I'm afraid. I've only ever got that error when it actually makes sense, i.e. I'm referencing a type in one assembly that I need to reference in another. I've used interfaces a great deal, but I guess I've just done what you did, specifying the full name inside the interface. You might try posting on the MS C# newsgroup and see if they have a better way of explaining it.
  6. If you are sufficiently prepared and have sufficient knowledge of both languages, then there isn't much difference either way. Both languages are equally capable of accomplishing what you want. An application written for .NET will probably be developed quicker than using C++, but will probably run slightly slower and start slower. You can target any version of DirectX with C++, but only DirectX 9 from .NET.
  7. There is no method in the .NET listview control to get or set the column order once you have set AllowColumnReorder to true and the user has modified them. However, in the following article someone has gone to the trouble of writing a class that uses the API to get the column order to serialize the listview. You should be able to extract the relevant information from that. http://www.c-sharpcorner.com/Code/2002/Dec/ListViewSerialization.asp
  8. This is not a VB6 forum.
  9. There is a separate compatibility namespace, the DLL for which is only referenced if you've used the upgrade wizard however. Using types in Microsoft.VisualBasic is not necessarily bad practice, but the types in there are not true .NET classes, in most senses of the word. They are only there as helpers for Visual Basic. There's nothing wrong with using them. On the other hand, a common viewpoint (including mine) is that it's bad practice to use them, because when you inevitably have to write something in C#, or even read something, or convert something - you're going to be disadvantaged for having relied on those helpers in the past. They can be very helpful for people struggling to make the transition from VB6 to .NET, but in my opinion the time comes when you don't need them to hold your hand any more, and you can use the pure framework like other .NET languages do.
  10. The license should be compiled in to the application and this shouldn't be a problem, as far as I remember. http://www.gotdotnet.com/team/windowsforms/Licensing.aspx That URL is pretty much the bible on .NET licensing, if you haven't been there already.
  11. I don't think this is possible, but if it is, I would like to know about it. That would mean that data could be changed depending on what application it was being dragged in to, and I had a need for that the other day.
  12. It means that in the assembly that contains your interface(s), you are referencing an assembly that you are not referencing in the project you are referencing the interfaces in. That's a bit wordy, but if you have a type from an assembly referenced by a member of the interface, your project with the class that implements that interface must reference that assembly too.
  13. It's only for managed C++ apps.
  14. The simplest way would be to make the picturebox the parent of every other control. Failing that, you can right-click on it and select Send to Back to force it to the back of the z-order.
  15. For a coloured border, look at the Graphics.DrawRectangle method. For a 3D border, check out the ControlPaint.DrawBorder3D method.
  16. To divide: number /= (1024 ^ iterations) To multiply: number *= (1024 ^ iterations)
  17. I may be slightly off track here, but one of the overloads for Graphics.DrawImage accepts a rectangle structure which it will scale the image appropriately to fit in to. You may be able to just get away with passing it the target rectangle and it will do everything for you.
  18. You use the help class, as I said. Consult the documentation on the Help.ShowHelp() method.
  19. I don't think it does, necessarily. The behaviour you're describing is odd though, I haven't played too much with transparent backgrounds on usercontrols but from what I've heard it shouldn't misbehave like this. One caveat of transparent backgrounds is that only the form background will show through - any other controls between the form and the control will not make a difference. Sorry I can't be more help on this.
  20. I have the final beta but can't bring myself to install it given the final release is in the near future.
  21. The only VB.NET book I've read is Professional VB.NET, by Wrox press. I found it very good.
  22. There is no API viewer. You can use the one that came with VB6 if you have that installed, and convert the declares manually. Other than that, you'll have to use internet sites or browse header files to find those declares.
  23. It's not working because there is no contructor on the File class, as it said. You can't just invent syntax like this. To copy a file, you use the static method of the File class: System.IO.File.Copy("C:\\dotNET Book\\Ch8_ADO.doc", "C:\\dotNETBook\\Sample\\Ch8_Backup.doc");
  24. Mid April is the latest I've heard. They are supposedly going to RTM (release to manufacturing) in a couple of weeks.
  25. C# doesn't support Optional parameters, your only choice is to use function overloading (a better design anyway).
×
×
  • Create New...