Jump to content
Xtreme .Net Talk

divil

*Gurus*
  • Posts

    3026
  • Joined

  • Last visited

Everything posted by divil

  1. wyrd, what else are you going to use in C# to cast except (type) ? You can use CType or DirectCast to cast types in VB.NET, DirectCast is faster. I rest my case.
  2. Personally I see CType as bad practice, just as I see using other VB.NET specific methods to be. As far as I see it, if you're using .net you might as well use the methods of the .net framework, it makes the transition to another .net language much easier. Use DirectCast to cast, and the framework methods to convert. (If you're using VB.NET).
  3. If you're passing a variable of type Form, you'll have to cast it to the actual class name (frmMain for example) before you can access members on it specific to frmMain. That or you can just have a variable of type frmMain to begin with.
  4. Protected members can be accessed from classes deriving from the first class. I know this to be the case, I've used it (yes, from different projects) many times.
  5. I typically use hungarian for all variables, and just prefix member variables with an underscore. Dim strThing As String Dim _intIndex As Integer As long as you're consistent, it matters little what notation you use. Unless you're part of a collaboration of developers of course, in which case you should force your notation on every one else (in my case, hehe).
  6. CenterParent is for when you show dialogs modally, using the ShowDialog method of the form. I recall it may only work when you specify the parent in the ShowDialog method, too. For example: Dim x as frmChild = New frmChild() x.ShowDialog(Me) Would show the secondary form in the center of the parent form, which I'm assuming the code to show it is in. That's if the startup position property is set correctly, of course.
  7. CType is just a VB.NET thing, I try to avoid it.
  8. I don't think so. You may well have to use the api.
  9. myInt = Int32.Parse(myString);
  10. You can't. This isn't a supported functionality of a tab page, you won't see this done anywhere in Windows. You might want to rethink your interface design. Perhaps you could disable all child controls of a tab page (would be trivial).
  11. Maybe the serializers only serialize public properties, and not fields? It would definitely be worth a try.
  12. Collections should serialize ok, dictionaries won't though. Read the docs on the xml serializers or search google, I found many resources on serializing collections when I had to do it.
  13. I assume you're using the VB.NET Collection class. You should really try and use one of the .NET collection classes under System.Collections. Anyway, since the VB.NET Collection class has no clear method it looks like you'll have to loop through it to clear it: Do While myCollection.Count <> 0 myCollection.Remove(0) Loop
  14. I find it useful for file formats. Where before you might invent a file format for your program, read it line by line and parse it to create your class, now you just use a couple of lines to serialize an instance of the class to disk in XML format (or other).
  15. SELECT * FROM Shipping WHERE ID = searchNum This looks wrong to me. Maybe you removed the string quotes for clarity, but you should be doing: strSQL = "SELECT * FROM Shipping WHERE ID = " & searchNum.ToString()
  16. No, I'm afraid you're out of luck on this one. You're only option would be to subclass and draw the items yourself.
  17. Perhaps he was posting in order to do the research, DevGrp. tezcanalinca, although .NET compilers output Windows PE EXE files, they are really only a stub of machine code that launches the .NET JIT interpreter/compiler to run the IL code.
  18. Nope.
  19. I had a similar problem (can't remember exactly what the error message was but it wasn't helpful) when trying to install .net from a writable cd drive under XP, with XP's cd writing enabled. If this is the case with you, try either turning off the cd writing and rebooting first, or copying the contents of all the cds to your hard drive, in the same directory, and running the setup from there.
  20. I belive you'll have to program this functionality yourself, although sometimes you can achieve similar effects with inventive use of panels and docking/anchoring.
  21. Agreed. I'll only worry when my app takes more space than a cd has to offer. My clients don't care as long as they receive a quality program.
  22. I never even knew of that method, wyrd. Just goes to show you learn something new every day.
  23. Have you established that your program actually *does* go on taking up memory forever if you just leave it? This sounds very odd to me. I have deployed a large number of .NET applications, professionally and not. None of them have exhibited this behavior. Due to the nature of the .NET framework programs written it do tend to take up more memory, but the thousands of lines of code that went in to the Garbage Collector were not in vain. If it thinks that the memory your program is taking up is depriving resources from another process, it will collect some garbage.
  24. Yes, that's the right way.
  25. Dotnetfx.exe won't complain if you don't have IE 5.01 installed. I know this, because I did it and then wondered why my app was generating funny exceptions everywhere.
×
×
  • Create New...