Jump to content
Xtreme .Net Talk

Volte

*Experts*
  • Posts

    2372
  • Joined

  • Last visited

Everything posted by Volte

  1. you have to use the SubString function. For example, Dim str1, str2, str3, bigStr As String bigStr = "Visual Basic .NET" str1 = bigStr.SubString(0, 3) str2 = bigStr.SubString(11) str3 = bigStr.SubString(5,5) str1 would be "Vis" str2 would be "c .NET" str3 would be "al Ba" If you leave out the second parameter, it will just get the rest of the string, from the character you specify. Otherwise it gets the number of characters you specify after the first index you specify. Remember, the params are Start and Length, not Start and End. You should never use the Mid, Left and Right functions, because they are part of the Visual Basic compatability library; something MS should have left out, IMO.
  2. The correct line is System.Windows.Forms.PaintEventArgs.
  3. You can try using a RichTextBox control. By setting the SelectionStart property to the position of the character you want to alter, and set SelectionLength to 1, then you can use the other Selection properties to modify the fonts and colors. The Text property will still return the normal text. Look in the Code Library for an example of a RoundedTextBox by Bucky. You can set the rounding to 0 and still change the border color, leaving you with a colored, square textbox. You have to modify Bucky's control to support the RichTextBox (not very hard at all) if you want both char-by-char control AND colored border. I believe that all you have to do is Inherit the RichTextBox instead of the normal TextBox.
  4. Please post full source for programs, not binaries, simply for fear of viral infection (viruses don't infect project files and code) or trojans.
  5. Doesn't really matter, as long as you're consistance. When I use C#, I use camel case for everything (camelCase) where the first letter is small. I don't use hungarian notation at all in C#. isValid, customerName, cancelButton, are all kinds of things that I personally use. However, I believe that in the MSDN there is a list of the hungarian notation conventions. From the top of my head: Form frm TextBox txt Label lbl Scrollbars hsc/vsc Slider sld Panel pnl (?) Picture pic Button btn For variables, I use (these are not necessarily "official"): String s Numbers (any kind) i Boolean b Char c
  6. I would definately NOT recommend using DX7 or 8. DirectX 9 is the only version that runs half decently on .NET.
  7. I don't think there is any way to do it with built in methods (too platform specific on that one), so you'll need to look into the old fasioned API methods. Go to http://www.allapi.net and look at the mci APIs (their the ones that start with 'mci'). Sorry I can't be of much help right now, but it's 4:07am. That should be a start though.
  8. I have this file, and from what I can see, it's just a blank project with nothing in it. Try creating a new blank project, saving it as EmptyProject.vbproj and copying it to the folder.
  9. I think Panel in VB.NET is basically what PictureBox was in VB6... I mean who really used them to display pictures? They were used as drawing surfaces, control containers, and buttons, but rarely was the PictureBox used over the Image control to display pictures. In VB.NET, the Panel, I believe, is what you use for a control container and whatnot, while the PictureBox is for displaying images (note the lack of an Image control). I'm not 100% sure which you should use for drawing on (when you're not using the form) in the case of a painting program or whatever, but I would assume the PictureBox. It probably doesn't matter much though.
  10. Just to clear up what divil is saying, most programs, when they accept command line arguments, require quotes around the arguments if they are multi-worded. For example, in the command prompt, to change directories, you type cd "C:\Program Files\Microsoft Visual Studio .NET", otherwise, it will take you to C:\Program if it exists. To open a file in notepad, it might be notepad.exe "C:\Documents And Settings\Joe\My Documents\notes.txt". So your line might be like this: Process.Start("C:\ORANT\BIN\PLUS80W.EXE", "@ """ & Application.StartupPath & "\seedlistp1.sql""")No guarantees that it will work though, of course. BTW, the double quotes are just because you need to use two to tell the compiler that you're inserting quotes into a string and not just ending the string. It's like \" in C.
  11. Heh, this is about coding standards, not the way it eventually turns out after it's compiled. :p
  12. Process.Start("C:\Program Files\Whatever\Blah.exe")
  13. So theoretically, my way is better than continue. ;) ;)
  14. Yes, the GDI+, as far as I know, will work on any platform that the .NET framework will work on.
  15. Try something like this:Dim fileIn As String Dim sr As New IO.StreamReader("C:\file.txt") fileIn = sr.ReadToEnd() sr.Close()
  16. I suppose the best way would be to use a Boolean. Do While MyCondition = True Dim continue As Boolean 'In C#, this would look like [b]if (This == "That") continue;[/b] If This = "That" Then continue = True 'This part skips all the code after the continue line, if necessary If Not continue Then 'You did not choose to go to the next iteration 'Nested continues should work as well. 'C#: if (Equation = (4+3/5)^4) continue; If Equation = (4+3/5)^4 Then continue = True If Not continue Then 'Once again, you didn't choose to go to the next iteration End If End If LoopI don't know if this is a total reproduction of the behaviour of continue, nor have I tested it, but it should work. :-\ Best you can do is give it a shot.
  17. Oh, ok. Then when you write the text file, add some delimeter (a comma, or something; make sure it doesn't appear in any of the words you want to retrieve from the file). So your file might looks like this: The,quick,brown,fox,jumps,over,the,lazy,dog When you read the textfile, read it all in at once, and use the Split function of the string you read it into, like Dim words() As String Dim fileIn As String 'Read your file into the fileIn variable here words = fileIn.Split(",")And now you will be left with words(), an array of strings containing all of the words from your text file. Loop through them and do whatever you wish with them (adding them to textboxes, I guess).
  18. What's the format of your textfile right now? Can you paste an excerpt from it so that I know exactly what you need?
  19. Dim tbox As New TextBox() With tbox .Size = New Size(100, 20) .Location = New Point(15, 15) .Text = "Hey!" End With Me.Controls.Add(tbox)That will add a new textbox to the form.
  20. Here is a function that seems to work. Just pass it the name of the process (without extention [notepad, not notepad.exe, etc.]) and it will return a boolean value. Public Function IsProcessRunning(ByVal process As String) As Boolean Dim processes As Process(), tmp As New Process() processes = tmp.GetProcesses 'Enumerate the processes and check to see if the process is there For Each tmp In processes If tmp.ProcessName = process Then Return True Next Return False End FunctionIt could probably be optimized by some use of IndexOf, but since you can't create a Process object and then change its properties, it wouldn't work as easily as that.
  21. Volte

    Need help!

    The correct line is Imports System, not Import System.
  22. Don't thank me, thank divil. He's the one who made the article. :)
  23. I agree; it's not really a broad/popular enough subject to warrent its own forum.
  24. That won't work regardless of OS. Bucky wrote a control that works as a textbox with rounded edges, but if you just leave the edges square, you can still change the border color.
  25. Nope. It would be possible to develop your own (possibly XML based) color scheme file that you can load and save, without too much trouble.
×
×
  • Create New...