Jump to content
Xtreme .Net Talk

Volte

*Experts*
  • Posts

    2372
  • Joined

  • Last visited

Everything posted by Volte

  1. I usually move the constructor outside of the #Region that the Winforms designer generates. Makes it much easier to edit.
  2. Dim runningTotal As Int32 = 0 Dim s As String For Each s In ListBox1.Items Try runningTotal += Int32.Parse(s) Catch End Try LoopThat should do it. It just iterates the listbox and attempts to add the value to runningTotal.
  3. As long as the item you're adding menus to is MenuItem, it doesn't matter how it's used. To add code to the project, simply add my source files to your project with the Solution Explorer. However, it would be easier if you simply made it into a separate DLL. Since it is a .NET DLL it doesn't require any registration and only needs to sit in the directory with the EXE.
  4. Control arrays are not supported by the Windows Forms Designer. The only way to do it is through code, or many separate controls with one designer (as shown above). Note that the sender parameter of the handler says what control raised the event. So, MsgBox("You clicked on grid " & DirectCast(sender, DataGrid).Name)is a better way (your way won't work properly for events that don't change the focus.
  5. Mine comes with full source, meaning you can add the source files to your project and use it, and it will compile directly into your project with no extra dependency. Also, attempting to keep your apps as one exe file is pretty pointless anyway. When you deploy your applications, the System.dll and System.Windows.Forms.dll and whatnot need to be deployed as well (for computers without the .NET framework), so you'll always have dependency.
  6. Set the SizeMode property to 'StretchImage'.
  7. Screenshot.
  8. Windows XP's "My Computer" features a bar with collapsible panels called the "Explorer Bar"; each panel usually has tasks you can perform, quick shortcut links, or information about the selected file. I've now designed a control which emulates this Explorer Bar. The code is fully commented and the properties are all documented. Shows how to use designers to enhance design-time support for controls Shows how to implement custom TypeConverters and UITypeEditors for the property window (as shown with the GradientCreator class). Shows how to make two different controls interact with each other both at run-time and design-time. Features: Colors are fully customizable (gradients may also be used in place of solid colors in all cases). Panels are collapsible and expandable (with option "folding" animation). Panel caption bars can be rounded or square, and have optional pictures (32x32 fits best, but any size will work). Possible additions for the future: Support for scrollbars (it did initially have this, but the AutoScroll property didn't work properly, so I removed it). Support for tiled images as well as solid colors and gradients. More customizable animation (speed, maybe other stuff [fading?]) Foward all bugs and comments to me via PM. xpebarcontrol.zip
  9. Seek and Ye Shall Find
  10. You can also just append ControlChars.CrLf before your append your text.
  11. You'll need to use [api]QueryPerformanceCounter[/api] for the highest precision.
  12. If the child can be maximized at all, it should have a maximize button. Is there a reason you need to remove it? I have my doubts that Windows can handle a maximized form that doesn't have a maximize/restore button. I really don't recommend straying away from the standard windows behavior, anyway.
  13. You can get the width and height of the screen with Screen.PrimaryScreen.WorkingArea.Width 'or .Height. Just subtract the width and height of your form from the respective screen dimension and it will be in the corner. As for fading, I'm not sure. There may be a way to make Windows automatically do it (like what it does for a menu), but otherwise try looking into the Opacity property. You may be able to do it that way.
  14. Since game programming is not a real subject in itself, but a broader subject made up of many different essential elements (graphics, maths, input, sound, etc), you should outlike what you think a game should have and research each task individually. I'm not exactly sure what you'd expect for an "RPG Game Tutorial". Believe me, you'll learn a lot more this way.
  15. Player.Play() not Player.Controls.Play() Controls is the collection of child controls (as in, buttons and listboxes and the like), not the play controls.
  16. There is no equivilant in C#, since you need to manually add the handler anyway. You'll also need to create a custom EventHandler and EventArgs class and delegate. Look for information on event handling on C# for more information.
  17. Sure. Add it to your project and change it's Compile Action to "Embedded Resource". Then access it like this: Image.FromStream([Assembly].GetExecutingAssembly.GetManifestResourceStream("Namespace.filename.ext"))
  18. Volte

    Recursion?

    Don't use Dir. :) Use System.IO.Directory.GetFiles() to retrieve a list of all the files in a directory and .GetDirectories() to get the directories.
  19. Volte

    colercoding

    Instead of Len("AddIcon") you should use the supported .NET way: "AddIcon".Length(At least I think that will work) Also, you should restructure your Do Loop so it doesn't need to use Exit Do. Do While start >= 0 start = txtconf.Text.IndexOf("AddIcon", start) If start >= 0 Then txtconf.SelectionStart = start txtconf.SelectionLength = "AddIcon".Length txtconf.SelectionColor = Color.RoyalBlue start += "AddIcon".Length End If Loop
  20. Volte

    colercoding

    It does have coloring ability though. You could simply use RTB.Text.IndexOf() to find each instance of the phrase you want to color, and then use RTB.SelectionStart, RTB.SelectionLength, and RTB.SelectedColor to change the color. More information on this in your MSDN.
  21. 1) Look at the [api]SetCapture[/api] API. 2) Not that I'm aware of (though I don't totally understand why you would need this... if you just ignore the event it will go away on its own). 3) Not sure why that is happening... Perhaps you should try loading all the images into an array of Image objects at load, and simply cycling through those, rather than continuously loading the images from the HDD. Also, instead of UBound(Pics) you should use the .NET CLR way Pics.GetUpperBound(0)
  22. DoEvents in .NET is System.Windows.Forms.Application.DoEvents(), but most of the time you can just use Application.DoEvents().
  23. Volte

    Icons?

    Don't know about distribution rules and whatnot, but you might look in SHELL32.DLL in Windows. You just need a good icon viewer.
  24. Don't worry Heiko... I haven't the faintest idea what they're talking about either, and I *am* a native speaker. :p
  25. -EDIT- Derek, your EliteVB class parsing thing seems to be broken. ASP.NET server error. :-\ -EDIT- Try something like this: Dim ofd As New OpenFileDialog ofd.ShowDialog() If (ofd.FileName.Length > 0) Then TextBox1.Text = ofd.FileName End IfRemember, you can always look in your MSDN help file for information about all the .NET controls.
×
×
  • Create New...