Jump to content
Xtreme .Net Talk

Volte

*Experts*
  • Posts

    2372
  • Joined

  • Last visited

Everything posted by Volte

  1. I feel I must point out that you shouldn't be using the MaskEditBox from VB6 in VB.NET; I think the most popular way of doing text-box validation is to use the 'Validating' event, along with the ErrorProvider component. Here is a tutorial on that.
  2. You could always add the images to an ArrayList that you create yourself, rather than using an ImageList. Unless you are binding the ImageList to a control which requires it (such as a toolbar), then I see no real need for using it like that. You could also build your own pseudo-ImageList control which allowed you to add items that did have a Key property (a class that you make yourself).
  3. Volte

    Width

    I don't quite understand... do you want to make the form the same size as the desktop width? Me.Width = Screen.GetWorkingArea(New Point(0, 0)).Width This will also take into account docked windows like ICQ that deduct from the available real-estate.
  4. Ah, I see what you mean now. D'oh! Still, is it not better to use a self-written function over a Microsoft-compat. library function, since they can only be accessed (easily) from within VB, whereas that function could be used in C# if it was required?
  5. It's in the 'Visual Basic Language Reference' portion of the MSDN, along with UBound, QBColor, RGB and others. I don't think it's a .NET function at all.
  6. Where is this IsDate function? The only one I could find in the object browser was in the MS compat. library, in with the likes of 'UBound' et al. My IsDate function looks something like this: Public Function IsDate(ByVal d As String) Try Dim dummy As Date = Date.Parse(d) Return True Catch Return False End Try End Function
  7. Perhaps I am just not understanding what is being done here. :-\ [edit]Oh, I see (just reread the original post)[/edit]
  8. Oh right.. you just need to cast it using(TextBox)myArray(1)
  9. I tend to stay away from using modules at all; if you use a shared (static, in C#) variable in a class, you can access it without needing an instance of the class. In Class1, public static NWDSAConnStrings g_ConnStrings;Then in Class2 you can either access it with Class1.g_Connstrings or add a using statement at the top of the class like this: using MyNamespaceName.Class1;and then just simply access 'g_Connstrings' like you would as if it was in a module.
  10. I haven't looked at the program attached, but assuming I am understanding correctly, you should always do it this way: DirectCast(myArray(1), TextBox).Text = "Hello there"Not only will you get intellisense, it will keep Option Strict happy (which you should always have enabled).
  11. Simple little class used to retrieve the associated icon for a particular file. There are two functions (both Shared, so an instance of this class is not needed) that you can use: GetAssociatedIconSmall This will get the 16x16 icon associated with a file. GetAssociatedIconLarge This will get the 32x32 icon associated with a file. Just pass it the name of a file, and it will return an Icon object containing the associated icon. Example: Dim largeIcon As Icon = AssocIcon.GetAssociatedIconLarge("C:\mirc\mirc.exe") associcon.vb
  12. Well, I'm using Opera, and there is still more space on the left than on the right. :-\ Not a problem (I didn't even notice it until I read this thread), but it looks the same as it did before. Ah well.
  13. You will have to create your own form to emulate a message box. Look at the 'ShowDialog' method of a forum to show a form that can return a value.
  14. When a character is lower case, then bit 32 of its ASCII code will be on; Notice that the ASCII character 'A' has a code of 65, and 'a' has a code of 97; exactly 32 apart. You will need to convert the string to a byte array and use the proper bitwise operators (Or and And Not) to set bit 32 on the character.
  15. I think new public string Moo is what you're looking for.
  16. Great. Thanks for that Derek. :)
  17. Well, I don't know about that. I think WinXP SP1 has it, and the new Windows .NET will definately have it. Try searching the MSDN for specifics about deploying applications.
  18. Does this happen on other programs you try and run as well, or just this one?
  19. You do indeed need the framework (20+ megs), but you don't need to include that in the setup if you don't want. If you wish to assume that the user has it already, or give them a link to download it from, then you can keep your program fairly small. I don't think it will be under 200k, but it will be fairly small.
  20. I believe the API you want is [api]EnumChildWindows[/api]. However, I don't know how to make API callbacks work in .NET, if they are not the same way as in VB6. You should be able to get the information you need from AllAPI (linked above) and MSDN.
  21. No it doesn't, though I think SP1 comes with it.
  22. Well, assuming the code is in the MDI parent, you would use: Me.MDIChildren
  23. You want to be able to add to it but not edit it? If you set the ReadOnly property to True then it will make it so that you can't modify it. If you mean you want to be able to edit only part of the RTB, then no this can't be done without using some slimy hack. You could try parsing out all of the text in the desired "editable" portions of the RTB and reinserting it after the RTB has been reset to it's original text. This would cause the text in the RTB you don't want to edit to revert itself back everytime you tried to change it, but would retain the text that you entered into the desired editable area. That probably didn't make too much sense, but it's hard to explain. If it is indeed what you're looking for, I'll try to whip up an example.
  24. Probably not, but then again, a lot of things couldn't be done that can in .NET. :)
  25. You can't just use the new instance of the form. You have to make sure you're using the same instance. I'm assuming you're using a For Each to check to see if the form is loaded; on the interation through the loop in which you determine it's loaded, use the Focus method on the form object that is assigned to the form loop: For Each dummy In mdi.MDIChildren 'if it's loaded then dummy.Focus(); 'end if Next
×
×
  • Create New...