Jump to content
Xtreme .Net Talk

Volte

*Experts*
  • Posts

    2372
  • Joined

  • Last visited

Everything posted by Volte

  1. Look at the ListView control in the MSDN.
  2. I will give you a hint though: look into plug-ins for Internet Explorer. There are many out there that do this, and writing another one is not really necessary.
  3. You may not be able to sell them legally, I dunno... You can distribute them freely though.
  4. Did you not see what I said in my last post? You must provide DrawString with a full rectangle (4 coordinates) to draw in. Look for the DrawString method in the MSDN for information about the different overloads. After all, how can it right align text when it does know where "right" is?
  5. Also, use the LineAlignment property of StringFormat to set the vertical alignment. Note that this will only work properly if you supply the DrawString method with a full rectangle to draw with, rather than just the X and Y coordinates.
  6. True, but all the code in classes is not just focused in subs anymore; you can have attributes, sub-classes, etc... you also need to have easy access to edit the rest of the file, since you can have more than one class inside one file. It might be productive in a VB6 environment, but in a .NET production environment the practice just doesn't carry over well.
  7. There are two ways to attach an event handler in VB; 1) The Handles keyword. If you create a subroutine with the proper parameters for an event (one parameter for the sender object, one for the proper EventArgs for the event), you can simply append Handles MyObject.MyEvent to the end and it will become the event handler for that event. Private Sub OnTextBox1Clicked(sender As Object, e As EventArgs) [u]Handles TextBox1.Click[/u] 2) The AddHandler keyword. If you create a subroutine with the proper parameters, you can use AddHandler to dynamically assign or remove an event handler to/from an event. AddHandler OnTextBox1Click, AddressOf TextBox1.Click
  8. Colors are serializable, so you should have no trouble. Are you remembering to tell the XML Serializer that you want to serialize it? For example, you usually make an array of all the types you want to serialize: Dim serTypes() As Type = {GetType(String), GetType(Drawing.Color), GetType(MyClass)} Dim xmlSer As New Xml.Serialization.XmlSerializer(GetType(Integer), serTypes) ' ^ The first param is the type you wish to serialize, and the second ' param is an array of other types you also wish to serialize. With ' the array above, you can serialize String, Color, MyClass, plus ' Integer. 'do the serialization here
  9. I'm almost certain that you can't do this in .NET, and with good reason; blocks of code are not simply procedures like the VB6. .NET is full OOP programming, so you can not only have procedure definitions in classes (you should never use modules, since it defeats the purpose of .NET and OOP) you can have other classes, attributes on procedures, variable definitions scattered throughout the file, etc. Not only that, but it'd be must less productive. You can use the #Region and #End Region directives to make portions of your code collapsable with a small title or description. This is great for keeping pieces of code separate without actually removing it from the code window.
  10. I wasn't comparing VB6 to VB.NET; I meant if you could buy either VB5 or VB6, which would you choose?
  11. If backward compatability with .NET 2002 is not an issue, yet. You cannot open a .NET 2003 project in .NET 2002 without some major tweaking (or simply adding all the code files to a new project), but other than that, yes. You should. After all, would you buy VB5 or VB6, given the choice?
  12. Do you have any specific questions relating to those two things? We don't write your programs for you, but if you are stumped on a particular problem, we'd be glad to help you out.
  13. You need to Import the System.IO namespace. Also, if you wish to store options using an XML file easily, I recommend that you take a look at XML Serialization. You could create a "ProgramSettings" class, serialize it, and deserialize it later. Serializing a class will transfer the structure and data of the class into XML format, and deserializing it will read it back into the class. It's very powerful and easy once you get the hang of it.
  14. DDE is no longer supported in .NET; You should look into the DDE API functions. Look in the MSDN at the API functions beginning with "Dde".
  15. This happens for me as well. Bob (webmaster) may be moving the attachments from external files back into the MySQL database (where they are by default) so that he can upgrade to vBulletin 3. Hopefully that will be happening soon, so everything will be running smoothly again.
  16. Look at http://www.windowsforms.com... you may be able to buy/download one there.
  17. If it is prefixed with an "I" it means it is an interface. There is no real functionality to it; it's just a "shell" of a class that consists of the declarations of all of the properties and methods, but no code. In your case, you need to use the one without the "I" in front. I suggest you read about polymorphism and other OOP concepts in your MSDN if you want to really understand it.
  18. If I'm not mistaken, a Windows Common Controls ListView has built in support for item indentation (in intervals of 16x16 I think; the size of a small icon). With a custom draw ListView (and a lot of code!) it shouldn't be too hard to emulate this. You'll need to be an API guru before you'll get very far with this. The alternative is writing your own control from scratch, and that might be easier than custom-drawing a ListView. The downside is that it won't be a Windows Common Control, so isn't compatible with the common controls in other programs. I suggest you look into the following things: LVITEM struct (the iIndent member, particularly) LVM_INSERTITEM SendMessage message You're going to have to do some heavy API stuff, since the built in ListView wrapper doesn't support all of the options provided in the LVITEM structure.
  19. Many times when I'm developing, I run the program and the IDE acts as though it's in debug mode (the toolbox and all that goes away, and I can't edit the code), but no program appears. All it takes is a click on the "Stop" button and then start it again and it fixes itself. Maybe you should search MS Knowledge Base?
  20. Go to your User Control Panel and turn on "Use Email Notification By Default".
  21. If you wanted to set the text of all controls on a form, you'd do something like this: Private Function SetAllTextProperties(ByVal textVal As String, ByVal rootContainer As Control) Dim c As Control For Each c In rootContainer.Controls c.Text = textVal SetAllTextProperties(textVal, c) Next End Functionand use it like SetAllTextProperties("test", Me)Remember that all controls have a controls collection (even if they aren't container controls), so you still check every control on the form for children.
  22. I realize that this may be caused by the server move that just took place and you may be already working on it now, but the Who's Online page is messed up... it shows that everyone is viewing Main Index.
  23. Just call the sub that handles it like you would call any other sub.
  24. Put it in a class, public and shared (static in C#). public class Globals { public static Int32 myGlobal = 4; }Then access it like this: Globals.myGlobal = 4;
×
×
  • Create New...