Jump to content
Xtreme .Net Talk

Volte

*Experts*
  • Posts

    2372
  • Joined

  • Last visited

Everything posted by Volte

  1. Use the BringToFront() method.
  2. I really would not recommend this at all. I would close/remove any program that changed my system settings without telling me. I don't *think* it's possible to do this without API... *checking* Declare Function SetSysColors Lib "user32" (ByVal nChanges As Integer, lpSysColor As Integer, lpColorValues As Integer) As Integer [api]SetSysColors[/api] Still, I really really don't recommend it.
  3. You don't even need to compile it; just create a new VB project in your solution and insert the class.
  4. You can use Debug.WriteLine to write to the debug window, or when you set a break point the Autos window will show the list of variables that are currently in use.
  5. On a side note, removing the reference to Microsoft.VisualBasic is useless; it is required regardless, and will be referenced anyway. Besides, they're not all bad anyway.
  6. Well, the way to do it is to add another line that pads ; with spaces in the php, like it pads "(" with " ( " and then back again at the end. So, it would need to replace ";" with " ; " and then back at the end.
  7. Volte

    on top

    As for installing a global keyhook... I understand that you are not making this program for malicious purposes (I have attempted to make the same project you describe, inspired by the recently deceased Project Dolphin). However, since installing a global keyhook could potentially be used for malicious purposes (password theft, etc), we can't help you with that here. Sorry. :-\ Even if you're not planning on using it that way, the information would still be available to just anyone looking to use it for whatever purpose. As for the Always on Top thing, just set the form's TopMost property to True. :)
  8. In Sub Main you need to use 'Application.Run()' to start a standard Windows Message loop to keep the program alive. If you use Application.Run()You can show forms and such normally, like you are doing; however, the program will not close itself when the last form is closed. You need to do it manually. The alternative is to do it like this: Application.Run(myForm1)This will start the program with myForm1 as the main form. The program will then shut itself down when myForm1 is closed (it is the main form now). If you need to be able to have myForm1 closed at any given time while another form is showing, then the first method is the best. If myForm1 is going to be showing at all times regardless of the other forms' visibility, the second method is best.
  9. OK, so use the 'GetFiles' method (as shown above) to get the files into an array (this will include extensions). Then when you do need the filename without extension: Dim noExt, dummy As String For Each dummy In TheListOfFilesArray noExt = dummy.Split(".")(0) 'noExt contains the file w/o extension so do something with it here Next
  10. I have one question involving Modules; when you start a new Console application, it gives you a standard module with a Sub Main() in it; is it possible to replace this with a class in some way, or is a module required in that case?
  11. You want a function that doesn't return files? I really don't understand what you're looking for. Perhaps you should tell us what the program is that you are trying to make?
  12. I don't understand. Do you mean you want to create a form that is named whatever the string is? I don't think that's possible, considering forms don't have Name properties anymore (their names are their object names; there is no seperate string property like in VB6). You weren't exactly clear about how the string ties in with the form instance. :confused:
  13. You're setting e.Handled = True inside the code that I gave you, and then setting it right back to false afterwards. Take out the 'e.Handled = False' line before the 'Else'.
  14. Ah; try putting it in the 'Closing' event. I believe that in the 'Closed' event, the form no longer exists, and therefore cannot be used like that.
  15. Are you making sure to put this code inside one of the MDI children, ranther than inside the MDI parent?
  16. Try it like this: Dim key As Char = e.KeyChar If key = "." Or key = "-" Then If TextBox1.Text.IndexOf(key) >= 0 Then e.Handled = True End If End IfDon't forget to check for the characters when you paste as well.
  17. Use Color.FromARGB(a.Next(1,255), a.Next(1,255), a.Next(1,255)) and it will return a Drawing.Color object.
  18. I believe it's caused by your string (used to get the Split results) being declared with a subscript already in place. Also, Don't use FileOpen! It is a bad method of doing things, left from VB6. You should always use the StreamWriter/Reader classes; Try this: Dim sw As IO.StreamWriter, sr As IO.StreamReader Dim myStringArr() As String sw = New IO.StreamWriter(New IO.FileStream("C:\Result.txt", IO.FileMode.OpenOrCreate)) sr = New IO.StreamReader(New IO.FileStream("C:\file1.txt", IO.FileMode.Open)) Dim tmp As String = sr.ReadLine() myStringArr = tmp.Split(",") sw.WriteLine(myStringArr(0)) tmp = sr.ReadLine() myStringArr = tmp.Split(",") sw.WriteLine(myStringArr(0)) sr.Close() sw.Close()
  19. Volte

    opacity

    Nothing will happen on OS's < 2000.
  20. How are you loading these pictures? Are you loading them from files? If you are, you could store the filenames of both pictures in variables and compare them that way.
  21. I don't think there is a way to do this easily (without manually comparing the pixels), because although the two pictures might look the same, they are two different objects. The '=' operator is not defined for Images, and the 'Is' operator will not do what you need in this case (because they are two seperate objects, not two seperate references to the same object). If you tell me what you are trying to do in this program, I might be able to help you come up with a better way than comparing the pictures in the picturebox.
  22. I believe divil means Option Strict, which prevents direct conversion from one data type to another where the possibility of data-loss exists.
  23. You could also look into using a DataGrid control; you can easily load in a DataSet and display the info, and it would probably do what you're asking about. I would suggest reading up on it.
  24. You need to use the Single or Double datatypes; Integer doesn't like decimals, so 100.60 rounds to 101, 100.01 rounds to 100. Dim ij As Single ij = Single.Parse(discount.Text) 'etcYou might also want to add in a Try...Catch error handling block just in case someone enters a non-number.
  25. VB.NET and C# are almost identical languages; the only thing largely different about them is the syntax. It will not be hard to port that code to VB.NET at all. Alternatively, you could create a C# class project in your program's solution, add that ping class, and then you will be able to use the C# class from within your VB project.
×
×
  • Create New...