Jump to content
Xtreme .Net Talk

mutant

*Experts*
  • Posts

    1922
  • Joined

  • Last visited

Everything posted by mutant

  1. You could declare and assign the instance to a private varibale in your form and simply call the Show method in your button click event if you only want one instance. One other method would be to keep a boolean variable in your form and set it to true when you open a form, and in your event check if false and create new form, else do not create a new form. Yet another method would be to enumerate all the MDI children and see if any form in there is of the same type or with the same name: For Each f As Form In Me.MDIChildren If TypeOf f Is YourFormType Then 'form of that type already open End If Next Simply saying, there is many possibilities :).
  2. NK2000, i just tested the code I showed and it works well. It will set the caret at the specified position. The textbox must of course have focus to show the caret at all.
  3. Did you set focus to the textbox?
  4. You want to move the caret ("the blinking one") to the end of the text right? This should help you: (I can't test it now) TextBox1.SelectionStart = TextBox1.Text.Length
  5. Decrypt, if you have VB.NET Standard, it does not come with Spy++.
  6. Dispose of the PictureBox's image before putting another one in it. PictureBox1.Image.Dispose()
  7. You are probably looking for one of the wizard controls, just like the one Divil made: http://www.divil.co.uk/net/controls/wizardcontrol/downloads.asp
  8. The Replace method would work if you assinged the result back to your variable. But, you should not use the old VB6 functions. String object provides better alternatives. It also has a Replace method. Dim spaces As String = "SOME TEXT SOME TEXT SOME TEXT" spaces = spaces.Replace(" ", "")
  9. I haven't played for as long to have explored everything, but in my opinion its faily well balanced now. :)
  10. Nerseus, Gauntlet is truly a classic. I still have it somewhere buried with my NES and Final Fantasy 1 :). As of right now I really got into Dark Age Of Camelot. Its a very nice MMORPG.
  11. Did you use Managed Extenisons? If yes, then the client computers must have the Framework. If you used the compiler to create a normal Win32 exe then the program should run fine given that all the dependencies are there.
  12. Something like this should help you (don't have time to test it): 'Create some path Dim path As String = "C:\some folder\some file.txt" 'Get the index of the last slash, and add 1 so the slash won't be included in the string dim filenamestart As Integer = path.LastIndexOf("\") + 1 'Take a part of the string which starts at the index we got earlier 'and set the length to the length of the string - the index we got eariler 'so the operation doesn't error and you get the whole name Dim filename As String = path.SubString(filenamestart, path.Length - filenamestart)
  13. If you do it for files only, the beauty of it is that you don't have to do it manually :). You can use the shared method of the IO.Path class, GetFileName. Dim path as string = "C:\some folder\somefile.txt" Dim filename As String = SYstem.IO.Path.GetFileName(path)
  14. Lets you say you have an arraylist. This is how you would fill it. 'Create a new ArrayList to store the contents of the file Dim arrl As New ArrayList 'Create a new StreamReader to read the file dim reader As New IO.StreamReader('path to the file") Try to read while there is something to read Do WHile reader.Peek() 'Add a line from the text file to the array arrl.Add(reader.ReadLine()) Loop 'then do the same for the next file
  15. Are the matching file names supposed to be in the same line? Or it doesnt matter which line they are on? To load the lines from the text file, you would use the System.IO.StreamReader class. Then using its ReadLine method, fill in an array, or an arraylist if you don't know how many lines there are.
  16. You are using the Owner property without actually setting the Spalsh as the owner. It will throw an error if there is no instance of the form in the Owner property.
  17. If all you are saying Divil will make it to the final version it will unacceptable. I understand they want to make the move the from VB6 not very hard, but there plenty more people who don't need to make a move, instead want to enjoy the new language instead of just a clone of VB6 with a different runtime.
  18. Using Keys.Left or Keys.Right instead of others should work. How did you attempt to make it work using the arrows?
  19. Using VS.NET 2004, only VB.NET will have edit-and-continue available. As far as I know there is no plans to include it in VS.NET 2004 for C#.
  20. If you want to open the form again, simply use the Hide() method instead of show so its not released from memory yet and you can use Show again. Something along those lines would work, but a class with shared members would be better :).
  21. If you are looking to create a news reader that utilizes the RSS standard then Googling for "RSS" will come up with some good results. Once you now the format you should be able to write a newsreader.
  22. I think im beginning to understand your problem now :). You are creating a new instance of the form everytime, so no matter what kind of an approach to take at checking if the form is open, it will always be closed. What you could do it have one variable of your form's type and use only that one without creating any new ones (you could make it shared for example).
  23. Im not really sure what you are looking for but this might help you: Dim someform As New Form '..... '..... If someform.Created Then 'The Created property will tell you if the form is opened 'The form was opened End If
  24. mutant

    #define

    .NET compilers support preprocessor directives but as far as I know only conditional directives, not ones like you show.
  25. Look into the Filter property. It will let you spceify what files the dialog which display. If you want txt only you can do something like this: savedialog.Filter = "Text Files (*.txt)|*.txt" Frst you set the desciprtion you want to apear in the FileType dropdown on the dialog, and then the extension for the given description.
×
×
  • Create New...