Jump to content
Xtreme .Net Talk

Volte

*Experts*
  • Posts

    2372
  • Joined

  • Last visited

Everything posted by Volte

  1. & and &= are the string appending operators.
  2. To remove the listbox scrolling animation you need to subclass it and do two things: 1) Intercept the WM_VSCROLL message and cause cause it to redraw the listbox (by invalidating it, forcing Windows to paint it). 2) Intercept WM_ERASEBKGND and ignore it; don't allow any processing to happen.
  3. GDI+ is optimized to be very fast with .NET -- using Win32 API with .NET will almost always be slower than using managed code optimized for .NET.
  4. If you guys like IE, I would recommend you check out Crazy Browser. It uses the IE engine (WebBrowser control I assume), but supports tabbed browsing and stuff. Neat-O. I used it for about 4 months before moving on to Opera (which is all I use now, despite being a bit buggy.)
  5. Neither one of those things were even close to impossibe. :D Also, I do agree that for the first day or two I felt like a novice, but I caught on after a day or two, and now I'm pretty competant in general. Things that took minutes in VB6 take minutes in VB.NET, and things that take hours in VB6 take minutes in VB.NET as well. :p The key is classes. For example, if you need to do something which can take many lines of code, you create a helper class to store it in, and perhaps duplicate the old VB6 way.
  6. Disasterpiece: did you make sure to set the Startup Object to frmMain (or whatever the form is called)?
  7. I don't think it's possible to completely remove IE from the computer, since it's so fully integrated into the OS... the WB control may still work, though I don't know for sure.
  8. You could set the Main form as your startup form (thus making it the form that the running thread depends on and closing it ends the program), and then show the Login form from the _Load event of your Main form.
  9. Actually, the better (I think) way to do that would be this (you would use this if you wanted to selectively add the items, rather than just all of them): Dim d As String For Each d In ArryEquipment ' If we should add this array item to the listbox then... lstbox.Items.Add(d) ' End If Next
  10. You might try something like this:Dim col As ListViewItem.ListViewSubItem Dim ret As String If ListView1.SelectedItems.Count > 0 Then For Each col In ListView1.SelectedItems(0).SubItems ret &= col.Text & "|" Next MessageBox.Show(ret) End If
  11. I would recommend against using many controls for this game, as they are unneeded, and since control arrays are unsupported (in the forms designer, anyway), it will mean more code than you really need. What you should do is use one single Panel control as the main "playing surface" and then programatically check the MouseDown events. What you should do is create a 2-dimensional array at form level, and store the values of each of the 42 spots (black, red, empty [or whatever]) in that. Then you can use the Panel's MouseDown or MouseUp event to both check the position of the point you clicked on, but also check legal moves, check for winning combinations, etc. If you want to use this method, you will need to read up on the GDI+, which lives in the System.Drawing namespace. Remember though, you should keep all your painting code in the _Paint event of the panel, otherwise you may run into redrawing troubles.
  12. Dim s As String = ListView1.SelectedItems(0).Text
  13. Alternatively, you could create a UserControl which uses the GDI+ to mimic the Shape and Line controls of Visual Basic 6.
  14. Which line is this error on? What is the context of this code (where is it in relation to the rest of your program)?
  15. You need to have the instance of the form object stored in a variable which can be passed to the class. At that point you can do myFormVariable.ComboBox1.Items.Add("This and That")To set a variable to a form's instance, put the following like on the Form's constructor or _Load event: myFormVariable = Me
  16. To do a case insensitive IndexOf, you could try this: myString.ToUpper.IndexOf(searchForThis.ToUpper):-\
  17. If you develop a custom Name/Image collection control/component (like a custom imagelist), and then use the built in collection editor to add the pictures (the ones without pictures would have Nothing for the Picture property), then the picture will be stored in the form's internal XML resource file. You won't have to worry about dependency that way. There is documentation in the MSDN about developing components and using collections, etc. If you prefer to do this without dependency, then I suggest you get reading. :)
  18. Here's another, possibly better way:Dim cols() As String cols = [Enum].GetNames(GetType(KnownColor)) ListBox1.Items.AddRange(cols)
  19. What non-color fields do you mean? The only non-color field I can see is 'value__' and that is easily removed. However, I believe the correct way to filter them would be this: If col.FieldType Is GetType(Drawing.KnownColor) Then
  20. I haven't tested this yet, but you might be able to get all the fields in the KnownColor type to get them. Dim col As Reflection.FieldInfo For Each col In GetType(KnownColor).GetFields ListBox1.Items.Add(col.Name) Next
  21. Right click the project in the Solution Viewer, click Properties, and then set the Startup Object from the General section.
  22. I tried to use 'p o s' as a variable name in some VB code, and the forum censored it out. :confused: Seems odd. :-\ [edit]Bah, the censor nailed me again.[/edit]
  23. Well, you can use a loop and keep searching the RTB text for that word, each time starting at the previously found instance. So, for example, Dim position As Integer Dim count As Integer position = myText.IndexOf("moo") Do Until position = -1 count += 1 position = myText.IndexOf("moo", position + ("moo").Length) LoopIt is untested and is probably a bit flawed, but you should get the idea. Once the loop completes, 'count' will contain the number of times the string was found. Normally I would recommand that you use the Split method of a String (using the word to find as delimeter), and checking the Length of the returned array, but it seems the Split method in .NET only accepts Char (single characters) as a delimeter, so this way is just as good I think. Loop
  24. You might consider using a RichTextBox class to load the RTF file in; then it will be just a matter of searching the Text property. Dim rtb As New RichTextBox() rtb.LoadFile("C:\SomeFile.txt") If rtb.Text.IndexOf("Search For This!") > -1 Then MessageBox.Show("Found") End If
  25. I would recommend re-installing Visual Studio. :rolleyes:
×
×
  • Create New...