Jump to content
Xtreme .Net Talk

divil

*Gurus*
  • Posts

    3026
  • Joined

  • Last visited

Everything posted by divil

  1. You would have to use string pattern matching and manually convert the strings to their proper types. I don't know much about regular expressions so that's about all the help I can give I'm afraid.
  2. You can't, directly. You can't make an entirely win32 executable file with .NET. There is a tool, ngen, which can compile all the IL in to win32 code and cache it, but it won't be stored in the application itself. This step is usually performed as a post-install task, and is usually unnecessary.
  3. That's more than sprintf than sscanf, though.
  4. Try changing all Long parameters in your declare to Integers, see if that helps.
  5. I guess Regular Expressions provide the most advanced capability for parsing data out of strings, I can't think of anything really closer to what sscanf does.
  6. Private Sub ListView1_ItemCheck(ByVal sender As Object, ByVal e As System.Windows.Forms.ItemCheckEventArgs) Handles ListView1.ItemCheck Dim l As ListViewItem Dim s As String = "" For Each l In ListView1.CheckedItems 'Do whatever you like with this item If s.Length = 0 Then s &= l.Text Else s &= "," & l.Text Next End Sub
  7. You'll have to take advantage of the build-in double buffering, which on the face of it is quite easy but you'll have to do a bit of work in this instance to get it working. Firstly, you'll have to inherit from Panel and use your own control instead, because you need to use the protected function SetStyle to enable Double Buffering and other associated styles. Then you'll have to give that control some kind of property for setting where the rectangle should be drawn. Finally, in the DragOver event, instead of drawing you set the rectangle property and call .Invalidate on the control, forcing it to draw itself. Double buffering in Windows Forms only works when the control draws itself in the Paint event.
  8. The ListView has an ItemCheck event which should trigger every time a checkbox is checked or cleared. You can then see whether it is checked using e.CurrentValue.
  9. The easiest way would certainly be to take advantage of the AutoScroll property of the Panel class, and place your pictureboxes all the way down the client area and below. You can use the events like Heiko said. You certainly _could_ develop your own component and draw them yourself, but I don't think this would gain you much in this instance unless you wanted fancy things like mouseovers etc.
  10. There is nothing included with the framework that does this, but there are countless free FTP components out there on the web if you do a search.
  11. All controls have those events, because the base class has them. It is, however, possible that the inherited controls already have behaviour for those events and aren't calling them at all. In which case, they can't get rid of the events themselves (inheritance doesn't let you do that) but they can hide the events from the property browser using attributes. Bottom line - if the event doesn't show in the property browser, it's probably for a good reason. But it's still there, and you can always wire it up with code on the off-chance that it still works. DiverDan: Yes I did write them, thanks for the praise :) Look out for a designable Outlook Bar there in the next day or two.
  12. Try using the AppendText method of the textbox, the caret should scroll down as you add text that way. If there is no existing text there this method will fail.
  13. Which control in particular? I found it for a textbox, for example, under the Action heading in the property grid.
  14. In .NET you have delegates, which are multicast type-safe function pointers :)
  15. Sorry, that code works perfectly. Replacing the path with the full path to an MP3 worked, dragging it in to winamp. When you drag files, all you are really dragging is a string array of paths anyway. If you're using a listview as your source for dragging multiple files, it has an ItemDrag event to cater for multiple items being dragged, so you use that instead of MouseDown.
  16. Can you elaborate? It's difficult to know what you mean. All .NET controls have a DoubleClick event, regardless of what language you are using.
  17. I think something like this is what you need: Private Sub PictureBox1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseDown Dim s(0) As String Dim d As DataObject s(0) = "c:\test.txt" d = New DataObject(DataFormats.FileDrop, s) PictureBox1.DoDragDrop(d, DragDropEffects.Copy Or DragDropEffects.Move) End Sub
  18. You can make it select a full row by turning on the FullRowSelect property of the listview. The built-in listview has no way of selecting individual columns, or hosting controls as subitems.
  19. I had a quick go, and I was able to do this. I opened the file: \VS.NET\Vb7\VBWizards\WindowsApplication\Templates\1033\WindowsApplication.vbproj And added the line: OptionStrict = "On" Just after the OutputType = "WinExe" line.
  20. There is an event you can use, AfterLabelEdit I think it's called. From there, you can cancel if the entered data is not valid.
  21. That won't help with what he's trying to do. That's to help with using COM DLLs from .NET.
  22. You're right. The context menu property is a red herring, you should ignore it. There is no way to relate a toolbar button to a menu item with the .net toolbar, you have to write code to associate them, i.e. call the menu's PerformClick() method in a switch or Select Case statement based on what button was clicked. In case you're interested, I developed a toolbar component which _does_ have this functionality. You can find it at this location.
  23. Using the End command is bad practice. If you need to terminate your message pump (which is what you need to do) stick Application.Exit() in the Closed event of your form.
  24. The only thing I can think of is finding the new project templates (they're there somewhere) and modifying them.
×
×
  • Create New...