Jump to content
Xtreme .Net Talk

divil

*Gurus*
  • Posts

    3026
  • Joined

  • Last visited

Everything posted by divil

  1. You can't. .NET is way, way higher level than handling IRQs. You'll have to do it in Visual C++. If you used the Managed Classes you might be able to expose your C++ program as a .NET class with an event, but it's going to be an awful lot of effort.
  2. Set the threads priority to BelowNormal or Lowest. You shouldn't be using DoEvents in a loop in a thread you've created. Perhaps we could help more if you explained what you're doing with these loops.
  3. I have Wrox "Professional VB.NET", and found it good.
  4. Maybe we should put that in a sticky thread somewhere since this same question seems to get asked in a different way every day.
  5. divil

    Classes

    Plenty of info in your help file on this: Classes: Blueprints for Objects [edit] Bah, something is screwing up the link. Just enter "classes" in to the VS help search tool. [/edit]
  6. divil

    Handles

    Maybe you should check my posts here: http://www.visualbasicforum.com/showthread.php?s=&threadid=34282
  7. Just after you've created each one
  8. When you create the buttons, assign their Tag property their index number in the array. Also, as you create them, you need to wire up their Click events: AddHandler btnArray(index).Click, AddressOf myEventFunction Then you create your event handler function: Private Sub myEventFunction(ByVal sender As System.Object, ByVal e As System.EventArgs) Dim btnSender As Button Dim intIndex As Integer btnSender = CType(sender, Button) intIndex = CType(btnSender.Tag, Integer) MsgBox(intIndex) End Sub
  9. Definstance? Was this the product of you running VB6 code through the upgrade wizard?
  10. I really don't follow your problem at all. I suspect if you need any more help on this issue you'll have to make a sample project which reproduces your problem and post it.
  11. It's on your Windows Component Update CD too.
  12. Instead of classes being in seperate files, they are marked in code with Class...End Class statements. There is only one filetype for vb.net files so this makes sense. In VB6 you'd have a class file, and give it a name, but in vb.net you just stick everything inside a Class...End Class in a file. The simplest Hello World example would be a console application, with no overhead of a Windows Form: Class Class1 Shared Sub Main() System.Console.WriteLine("Hello, World!") End Sub End Class
  13. I think you have BringToFront and SendToBack methods. You can add a WebBrowser to your toolbox by right-clicking it and selecting "Customize Toolbox".
  14. divil

    DefInstance

    Microsoft didn't remove the ability per se, you just have to understand that in VB.NET you have Classes, and you have Structures. There is no special case for forms as there was previously. A "form" is just a class with some pre-written code. You can't just get a default instance of a class, that's what Shared members are for. I hope that makes it clearer.
  15. divil

    Handles

    In your sub, I suggest you do this: Dim picSender As PictureBox 'This is ok if you know the only thing to raise this event is going 'to be a PictureBox control picSender = CType(sender, PictureBox) Once you have that code, you can use picSender as the instance of the PictureBox that was clicked. If you need to get the index of the array, you can loop through your array and check for equality with this object using the Is operator, or you could possibly just store the index of the array in the Tag property of each PictureBox when you create them.
  16. Just calling a frmEditOrder.Show from the MDI Parent form is not enough to tell the new form to be a child form. You have to do it like this: Dim f As New frmEditOrder() f.MDIParent = Me f.Show()
  17. I don't think that will be possible, per se. Not with the standard toolbar control. You could subclass it and get the coordinates of the mouse over the control when it is moved, but you'd still have to map that to the buttons somehow. You're probably better off searching for somebody elses toolbar component which supports this functionality, or writing your own.
  18. No, but your code could be better. I don't understand why you're trying to hide an MDI Child form that is losing the focus. That doesn't make any sense to me. Under normal MDI operations, the parent MDIChildActivate will fire when the focus changes from one MDI Child to another, or when the last child is closed. You don't have to have an array of names to check which form is the active one, instead you can use the Is operator to check object equality: If Me.ActiveMDIChild Is frmObjectArray(1) Then If you really must hide a child that goes out of focus, you could perhaps try the BeginLayout and EndLayout methods of the parent form, to indicate you're performing a multi-step operation and it shouldn't redraw or raise certain events.
  19. I don't understand what your problem with using the MDIChildActivate event of the parent form is. If you're desperate for code in a child form to run on this event, just run it from the parent form!
  20. The datagrids and such are a part of the .NET framework runtime.
  21. divil

    Handles

    That's what the sender object is for, that is passed to the method. If you cast it using CType to a Button, or whatever type it is, you then have the button that raised the event.
  22. divil

    Handles

    Get rid of the "Handles b.Click" after the method declaration, you don't need it since you're wiring them up manually.
  23. .Closing and .Closed
  24. Why would you use those old methods of doing this? Personally I've never used a "current directory" in any version of Visual Basic. There is an Environment.CurrentDirectory, if that helps.
  25. Not as far as I know, but then, I don't use the FileSystemObject. If I were you, I'd use the native .NET methods located in the System.IO.Directory class.
×
×
  • Create New...