Jump to content
Xtreme .Net Talk

divil

*Gurus*
  • Posts

    3026
  • Joined

  • Last visited

Everything posted by divil

  1. No, the only way to change the text of a label at design time is to use the properties window I'm afraid. Good idea though.
  2. You can use the methods of a Graphics object to draw a grid, and to calculate which box in the grid the user clicked on, perform an integer divide on the mouse coordinates, by the size of the grid.
  3. I guess you could use a For loop to instantiate them and place them on the form at appropriate places. You could add them to the controls collection in the loop.
  4. There isn't a Forms collection in VB.NET, and I haven't a clue what you're trying to do.
  5. The source code for the Garbage Collector is available. You don't have to take their word for it.
  6. Why use the Load event at all? Why not put initialization code in the form's constructor after the InitializeComponent call?
  7. You can use this short snippet of code to clear all the text boxes on a form (or other container control). The code recurses on itself so if you have textboxes in another container control on your form (a groupbox for example) they are cleared too. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click ClearTextBoxes(Me) End Sub Private Sub ClearTextBoxes(ByVal parent As Control) Dim c As Control For Each c In parent.Controls If TypeOf c Is TextBox Then c.Text = "" ElseIf c.Controls.Count <> 0 Then ClearTextBoxes(c) End If Next End Sub
  8. Can you post the code you have so far?
  9. I think you're going to be out of luck on this one. Tab pages aren't really supposed to be used that way.
  10. If the Form2 is an mdi child, you can cast the parent form to the correct type to access the status bar: DirectCast(Me.MDIParent, Form1).StatusBar1.Panels(1).Text
  11. divil

    Using Shell

    System.Diagnostics.Process.Start("wordpad.exe", "c:\filename.ext") That's how to pass arguments.
  12. divil

    Icons

    Right-click on your project and select Properties. You set the icon in the dialog that appears.
  13. What browser are you using? If your form is indeed called Form1, which I assume it is if the __EVENT things are set property, that line should certainly work.
  14. http://www.zdnet.com.au/builder/program/windows/story/0,2000035027,20269412,00.htm Maybe that'll help. I don't know if they are faster in any way, I would doubt it in fact. I just use them because if I'm exposing a collection of something, I don't want joe user adding just anything to it and breaking my code :) Also, designers know what to do with it if it's a strongly-typed collection.
  15. Is there a specific area you're having a problem with? The key to doing this will be the FileSystemWatcher class. It can tell you when the files are created, and (I think) you'll be able to use it to tell when the files are closed by the ftp server. At that point you can move them.
  16. The Directory.GetFiles method returns a string array of all files in a directory. Presumably, the first element in this array will be the "first" file in the directory. When you have the path to the file, you can use File.Open to open it.
  17. There is no member of the Directory class to copy a whole directory, you'll have to do it manually, file by file using File.Copy. If you need to do subdirectories as well your code will have to recurse on itself.
  18. Straight from the help: Dim from As String = "from@microsoft.com" Dim mailto As String = "to@microsoft.com" Dim subject As String = "UtilMailMessage001" Dim body As String = "<html><body>UtilMailMessage001 - success</body></html>" SmtpMail.Send(from, mailto, subject, body) string from = "from@microsoft.com"; string to = "to@microsoft.com"; string subject = "UtilMailMessage001"; string body = "<html><body>UtilMailMessage001 - success</body></html>"; SmtpMail.Send(from, to, subject, body);
  19. You'll have to be more specific, there are dozens of classes in the framework that have a RemoveAt command. Oh, and pressing F1 might help too :)
  20. http://www.c-sharpcorner.com/Code/2002/Oct/ColorSyntaxEditor.asp Looks like this guy has managed it.
  21. You'll have to store each plot as you add it to the form, and when the time comes to paint, draw them all.
  22. You can't just remove items from an array. The clear method you are using is in fact a static method of the Array class and isn't appropriate. You need a collection-based class to be able to remove items like that.
  23. You are correct. However, I can see no useful application for this. You could walk the methods of the class using reflection and execute them without late binding if you had to. In practice if you were compiling class libraries on the fly, you would know a type or interface they would adhere to. Remember, C# can do virtually everything VB.NET can do and it doesn't support late binding, period.
  24. Though writing an FTP class isn't terribly difficult, I have seen quite a few out there that are downloadable. If you do a search on Google it should yield quite a few results. Most will be in C#.
  25. You have to draw a rectangle with width and height 1.
×
×
  • Create New...