Jump to content
Xtreme .Net Talk

Volte

*Experts*
  • Posts

    2372
  • Joined

  • Last visited

Everything posted by Volte

  1. No tab control should ever have 20 tabs on it; that's usually very poor design (I'd have to see it to judge, but I can tell you right now it's probably pretty bad). To answer your question, there's no real easy way to do that... you could make it add all the controls onto the tab programatically, but the problem arises when you have code in the controls. To do what you're suggesting you'd need to program your own designer as well as some sort of Windows Forms host. My suggestion is that you break the program down into small forms that are related in function, rather than try to cram everything onto one big form.
  2. You will be happy to know that vB3 (which is coming very soon, I think) has a feature that allows exceptions to the 3-letter rule. If the words "ADO", "row", "dll" and "ocx" are added to the exception list, they will be indexed and you will be able to search on them.
  3. Post count is good to keep for statistical purposes, and it is always nice to know how much you have contributed. :) We don't have much trouble with it, and what little we may have... well, that's why we have moderators. :p
  4. The system of ranking's (Junior Contributor, Contributor, etc) seems to cause people to post like maniacs to get a new title. Not that I ever experienced that, of course..... ;) In theory, eliminating the ranking bit might eliminate that particular flavour of spam, but some people would just find another reason to spam.
  5. Well, KeyPress is the sub that does the "typing" of characters in a TextBox or whatever; KeyUp and KeyDown fire when you press a key (no matter what happens to the text in the textbox). You need to use KeyPress to handle the typing of text and KeyUp/Down to handle the pressing of keys in general (be it F12 or Control-H).
  6. Er yes... use the same way I just said. It works in all three.
  7. In the KeyPress event:e.Handled = True
  8. Heh, at 1024x768, fullscreen OpenGL mode, it's the same speed as the original game. :)
  9. Heh. Someone has too much spare time. :p Really cool find though. :)
  10. There is no menu editor in VB.NET like in VB6; if you add a MainMenu component to your form you can design the Menus visually (even more easily than in the menu editor of VB6). Then you can just double click a menu item to add code to it. If you want anything really detailed, either read about it in the MSDN, or buy a .NET book. It's not too hard to figure out though.
  11. I use event handlers, because you have more control; you can remove/add the event handlers at runtime, and change their names if you want from OnWhatever if you want.
  12. Erm... there is no "Procedure Constant" -- you need to create it yourself. Somewhere in the form, create this procedure:Private Sub ComboTextChanged(ByVal sender As Object, ByVal e As EventArgs) 'this code will fire whenever the text of the combo changes End Sub
  13. You can download an Outlook bar like the one in Outlook XP from divil's .NET site: http://www.divil.co.uk/net
  14. You could draw two different rectangles around the outside of the green one (long, narrow ones) to cover the orange parts. Is there a reason you don't want to redraw the second rectangle? It'd certainly be easiest.
  15. You should try the same server, but join #visualbasicforum -- a lot of times there are a few .NET users in there that aren't paying much attention to #dotnetforums (including me). That channel never really panned out to be anything.
  16. TextBox1.AppendText("Line1" [b]& Environment.NewLine &[/b] "Line2")The bit in bold is what actually separates the line.
  17. [api]GetWindowRect[/api] API should do it.
  18. Your example looks good to me, assuming that inheriting from that class into a new class will create a new set of static variable for that class, rather than just using the static variables of the parent class. In the latter case, it would throw the reference count way off... I think it will handle it properly though.
  19. To make decent multicolumn combo boxes, you'll need to OwnerDraw the items (set the DrawMode to OwnerDrawFixed). You'll also need to create a custom class or structure in which you can put more than one column into. You can then use the method Cassio mentioned to get the widths of each item (in the MeasureItem handler) and draw the text of the items and their subitems accordingly, and in the correct spot. The reason this is necessary is because when owner drawing, you can position the text of the items absolutely; meaning, at any pixel location within the item boundaries. Without ownerdrawing, you need to rely on the size of spaces, which is not reliable at all, so you will never get a perfectly aligned column. Search for owner-drawn objects in your MSDN to get information on ownerdrawing objects.
  20. That's exactly the way COM classes work. :) They keep a reference count, incrementing on initialize, decrementing on finalization. Also, you needn't worry about the garbage collector; unless you mark an object for disposal with the Dispose method, the GC will only collect objects it is sure are not in use. Even when you do Dispose it, I'm not sure that GC will attempt collection until the object is finished.
  21. dynamic_sysop: You would be able to achieve the same behaviour with this code:Private Sub ButtonClick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click, Button2.Click MessageBox.Show(sender.name) 'depending on which button was clicked, it could show "Button1" or "Button2" End SubNo need for multiple handlers. :)
  22. Those things are simply for the event handlers. When you handle an event, there are always two parameters: sender is the object which invoked the event. If your event handler only has one object attached to it, it will always be that object. If it has more than one object attached to it (for example, 5 buttons that all use the same event handler), it will depend on the control who's event was triggered. e is an EventArgs object, or subclass thereof that contains arguments specifically pertaining to that event. Generally, there is a special EventArgs object (inherited from the EventArgs class) for each event. For example, the MouseMove handler will have a MouseEventArgs object, which contains the X and Y coords, the state of the buttons, etc. These things only apply to event handlers though; you don't need them for regular subroutines. To create a subroutine that takes parameters: Private Sub MySub(ByVal a As Integer) MessageBox.Show("You passed " & a.ToString()) End SubThe sub would then be accessed by MySub(5)You can also create optional parameters, or parameters of different types using overloading. In addition to the first example I gave, you could create this sub: Private Sub MySub() 'note the lack of any parameters MySub(100) 'call the [i]other[/i] MySub with 100 as the parameter End SubThen both of these would be valid: MySub(5) 'shows "You passed 5" in the message box MySub() 'shows "You passed 100" in the message boxYou can read more about subroutines and overloading them in the MSDN.
  23. Volte

    Send E-mail

    That's not necessarily true; he just needs access to an SMTP server. In theory, you can use any SMTP server that he has access to (usually on a LAN or with an ISP), but if you wish to send mail directly through the client's computer, it will need some form of SMTP server installed on it. Even Outlook requires you to type in server info in order for it to be able to work... I may be way off base here, but that's how I think it is.
  24. Volte

    Send E-mail

    No, they are not the same. In order to use the CDO from .NET, you must have access to an SMTP Server; if you are using an NT-generation Operating System like Windows NT, 2K or XP, I believe there is an SMTP server installed with Internet Information Server. If you have installed it, you should be able to configure it from your IIS settings (Control Panel -> Administrative Tools -> Internet Information Services).
  25. With DoubleBuffering on, you must also set AllPaintingInWmPaint and UserPaint styles on to be effective. Furthermore, you must also do all of your drawing inside the OnPaint handler. If you are confused about GDI+, there is a rather large section on it in the MSDN. Do a search in your MSDN index for GDI+.
×
×
  • Create New...