Jump to content
Xtreme .Net Talk

Bucky

*Experts*
  • Posts

    803
  • Joined

  • Last visited

Everything posted by Bucky

  1. Well if you can do it with batch files, then have your program create the batch file, run it with Process.Start(), and then delete the batch file.
  2. Menu Owner Drawing (OD) is really easy and cool in .NET. Check out this example: http://www.xtremedotnettalk.com/showthread.php?s=&threadid=69043 http://www.xtremedotnettalk.com/showthread.php?s=&threadid=69046
  3. Heh, me neither, Robby. :) The method I use to clear a textbox is TextBox.Clear(), which is essentially the same as TextBox.Text = ""
  4. Have a look at the static Microsoft.Win32.Registry class for registry access and manipulation: [mshelp]ms-help://MS.VSCC/MS.MSDNVS/cpref/html/frlrfmicrosoftwin32registryclasstopic.htm[/mshelp]
  5. Create a boolean value and set it to True whenever you want to "skip" the event. Then, as the first line in the event, and check if the value is true. If it is, then set the value to false again and exit the sub (Exit Sub in VB, return in C#).
  6. When you call MessageBox.Show, pass the form you're calling to one of the overloaded methods (it's the first parameter). That way, the box will always show in the center of the form, I'm fairly sure.
  7. What is a ListBar? Is there something like it in Windows that you're looking for?
  8. To view an HTML document, you'd need the WebBrowser control, like divil mentioned, or you could launch it directly in a browser if you wanted.
  9. ...or you could access the HTML DOM directly by referencing Microsoft.mshtml in your project, and work with the HTMLDocumentClass class (in the mshtml namespace).
  10. SelectedIndex is an Integer, not a String, so you shouldn't assign it to "-1" here, but rather -1. (from your first code snippet) cmbBoxName.SelectedIndex = -1 If cmbBoxName.Text <> "" Then cmbBoxName.SelectedIndex = -1 It looks like Phil's question was answered, so I'm not sure that any further discussion is necessary.
  11. myCombo.Items.Clear()
  12. That was two questions, not one, but I think I'll manage. :) To disable typing the combobox, set its DropDownStyle property to ComboBoxStyle.DropDownList. If the user didn't select anything, then the SelectedItem property will be equal to Nothing. If myCombo.SelectedItem Is Nothing Then ' Nothing is selected End If
  13. You need to compare the Type of the ActiveControl to the Type of a textbox, and if they are equal then you can do the cut, copy, and paste: Private Sub mnuCut_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuCut.Click Dim activeType As Type = Me.ActiveControl.GetType() If activeType.Equals(GetType(TextBox)) Then 'Declare a Textbox as object and set it to the ActiveControl Dim objTextbox As TextBox = Me.ActiveControl 'Copy the text to the clipboard and clear the field. objTextbox.Cut() End If End Sub
  14. What is the code you're using to Cut, Copy, and Paste? The menu items won't do anything unless you add code to do them.
  15. It's looking more and more like C++ every day... :) That looks cool.
  16. Draw a rectangle with a width and height of 1.
  17. Some more answers, from another point of view... 1) You actually need the .NET Framework SDK, but this is done automatically in the VS.NET install. Make sure you have plenty of HD space, as the install can be huge with all the help files and such. 2) You can't convert VB.NET projects to VB6, but the programs coexist peacefully. 3) A bit 4) If you have ActiveX DLL's and controls, you can use them on Windows forms by referencing them in the project via COM.
  18. Unless you're setting the data classes to something else later in the code, when you declare the variable you need to include the New keyword to initialize a new instance of the class. Otherwise, they will be equal to Nothing (null), and you can't do anything with them. That's the cause of the error... you're passing Nothing to the Add method. I'm not familiar with the constructors of these classes, so you may need to pass some parameters to the constructors. Dim dsOneDay As New DataSet() Dim dGridTableStyle As New DataGridTableStyle() Dim dGridColumnTime As New DataGridTextBoxColumn() Dim dGridColumnUser As New DataGridTextBoxColumn() [edit]Added a little more info[/edit]
  19. Or check out EliteVB's class: http://www.elitevb.com/content/01,0077,01/01.aspx
  20. This is a perfect situation where the System.Xml.Serialization namespace comes into play. Using XML Serialization, you can easily go from a class, to an XML file, and back again. Before you can use it, however, you need to turn all your variables into properties of a single class. Then you can just load and save this class as needed. You will most likely want to encrypt the values before saving, and edcrypt them when you load them, as it is insanely easy to change them just by opening up the XML file in notepad. This encryption can be done with classes in the System.Security.Cryptography namespace. For information on XML Serialization: [mshelp]ms-help://MS.VSCC/MS.MSDNVS/Cpqstart/html/cpsmpnetsamples-howtoxmlserialization.htm#cpsmpreadwritexmlsample[/mshelp] [mshelp]ms-help://MS.VSCC/MS.MSDNVS/cpref/html/frlrfsystemxmlserializationxmlserializerclasstopic.htm[/mshelp] And for info on encryption: [mshelp]ms-help://MS.VSCC/MS.MSDNVS/Cpqstart/html/cpsmpnetsamples-howtocryptography.htm[/mshelp] [mshelp]ms-help://MS.VSCC/MS.MSDNVS/cpref/html/frlrfSystemSecurityCryptography.htm[/mshelp]
  21. Or you could do... Dim c As Char = Convert.ToChar(65)
  22. Ah, I hadn't thought about that, and that would work great for the situation that I just described, I'm fairly sure. But just now I realized that the description was incorrect... oops. The sub that I'm throwing the error in is a sub that is called asinchro-... asyncron-... asyncren-... uh, it's called async. :D Anyway, it's a sub that's reading from a socket, so there's no calling code of the sub to catch the exception. I'll just set a protected string to the error description, and have the main method that's called raise the error if the string contains something. Thanks Tim :)
  23. Because of the way VB.NET compiles and runs, you cannot edit code while the application is debugging; you need to stop it, change the code, and recompile to debug the changes.
  24. In that case, just use the Replace function: filename = filename.Replace(" ", "%20")
  25. filename = System.Web.HttpUtility.UrlEncode(filename)
×
×
  • Create New...