Jump to content
Xtreme .Net Talk

divil

*Gurus*
  • Posts

    3026
  • Joined

  • Last visited

Everything posted by divil

  1. There's no way built in to the .NET framework. Look up the ExitWindowsEx API instead.
  2. You create a generic handler which you wire up to every menuitem. The sender parameter of the event is the menuitem that raised the event. Sub CxMenu1_Click(ByVal sender As Object, ByVal e As EventArgs) Dim m As MenuItem = DirectCast(sender, MenuItem) 'Process depending on what m is End Sub
  3. divil

    IIf

    Using IIf is slow because its output isn't strongly typed, and it's generally regarded as bad programming practice.
  4. As I said, you need to read up on the command line parameters of the compiler. That is all.
  5. Using that value is pointless, it will change. Why aren't you just catching a TimeoutException?
  6. *looks around* Who you calling .net geeks? ;)
  7. I would tend to agree, I think he's full of it too. I would suggest calling MS, isn't there a number like 1-800-RULEGIT or something you can call if you're in America? They will help you determine whether your product key is legitimate, and also tell you what you should have received with the product.
  8. Volte is right. You can set up your handler to catch different types of exceptions as follows: Try System.IO.File.Delete("c:\test.txt") Catch ex As System.IO.FileNotFoundException 'Statements Catch ex As System.IO.IOException 'Statements Catch ex As System.Exception 'Statements End Try
  9. There you go then. When you omit debug symbols from a build, there is nothing to tell the debugger whereabouts in source code you are.
  10. Right button on project, Add Existing Item.
  11. C# enforces strong typing of everything, VB.NET does not by default. Everyone writing VB.NET should go in to the project options and turn on Option Strict, which forces you to do things properly. To strongly type the WebBrowser.Document property, you need to reference MSHTML and cast the property to HTMLDocument, or IHTMLDocument2 or whatever the type is.
  12. Does the WebBrowser control have its Dock property set to Fill? Does it work with other controls embedded, i.e. a textbox or something?
  13. I guess it must just be a VB.NET thing. Nice to know the difference though, I didn't know you couldn't do that in C#.
  14. Exactly. Properties are an interface between private fields and the outside world. If you have a control that paints itself, you need a text property, so that when the user calls the Set method, you know to redraw your control. For more info on properties, I suggest you read the documentation.
  15. Nope. If you read the sticky thread I posted at the top of this forum, you will see that the bare minimum you have to distribute is the framework runtimes (21MB). After that, you need to copy your dependancies (Interop.excel.dll).
  16. Sadly VB.NET doesn't enforce parens when calling a function with no parameters.
  17. But you _can_ call a static method on an instance :)
  18. All this information is covered in great details in the help file, within the Visual Basic .NET language reference.
  19. Did you actually build your project with debugging symbols turned on (i.e., using the "Debug" build configuration rather than the Release one).
  20. What errors do you receive? You may need to read up on the command-line parameters of the various .net compilers. You'll need these to reference assemblies and specify default imports and project output type.
  21. Brinkster is great for an amateur website.
  22. When using transparent colours on controls, I think the best you'll get is the actual form background (i.e. that gray colour) showing through. To achieve proper transparency effects, you'll want to be painting everything yourself, using GDI+. This isn't quite as daunting as it sounds, the documentation is quite good and there are a lot of samples out there. If you want to draw three images that have transparent sections, it should be quite trivial. It is a matter of overriding the form's OnPaint method (or responding to the Paint event) and doing all your drawing in there.
  23. There is no way with the classes that are provided to you by default in the framework. You might be able to find a parallel I/O class floating around somewhere, which would give you what you need with regards to the dot matrix printers. The other alternative is to develop a COM component with VB6 that opens the LPT port for output and writes strings to it, and use that from .NET.
  24. That code looks fine to me, step through it with a debugger and you may find that the WriteLine is only being called once.
  25. I don't think there's any such feature in the VB.NET code editor.
×
×
  • Create New...