Jump to content
Xtreme .Net Talk

Volte

*Experts*
  • Posts

    2372
  • Joined

  • Last visited

Everything posted by Volte

  1. For the time being, I would say that VB.NET is not practical for shareware apps; not many people have the framework yet. However, in the future, Windows is going to come shipped with the framework, so all you will need is the EXE and required files to run it. Right now, though, you're right. Not many dial-up users will want to download 20MB DLLs to run a shareware program.
  2. Just a suggestion; If you want to have user-friendly error validation, look in Tutor's Corner (or was it Code Library?) for divil's tutorial about using the ErrorProvider component. It allows for non-intrusive, yet effective error notification.
  3. Volte

    IIf

    You should never *need* to use IIf. In VB, you might have done: MsgBox "The lightswitch is: " & IIf(lightswitch.State = lsOn, "On", "Off")But you can do it just as easily in either language like this: Dim displayState As String If lightswitch.State = lsOn Then _ displayState = "On" _ Else displayState = "Off" MessageBox.Show("The lightswitch is: " & displayState)
  4. AFAIK, exceptions don't have numbers; they are actual classes, rather than just an ID with a description.
  5. No, Shared means that a sub inside a class can be accessed from anywhere, without declaring an instance of the class. In VB6, a public method in a module did what a shared method in a class does in VB.NET; although modules still exist in .NET, you should use Shared methods in classes.
  6. Go right ahead! :)
  7. Static var As IntegerWhen the variables go out of scope, they retain their values (though can't be accessed from outside of the procedure they're declared in). The term Static comes from the fact that the variable keeps a static location in memory, thus preserving the data.
  8. http://www.xtremedotnettalk.com/showthread.php?s=&threadid=69043 Thank you, come again. :)
  9. Yeah, I know, I used to use it myself. :) But for a professional website, or even one where you're going to be getting a lot of traffic, Brinkster isn't very good. Not to mention the lack of free FTP. :-\ The pay one is not too bad though.
  10. Like divil said, it's probably best not to use them, and find something a bit more professional. Please read the entire thread before posting.
  11. Those aren't available in C#. That's why you do it this way. Likewise, the event button is not available in VB.NET.
  12. Thanks, Bucky.
  13. Are you first declaring the class as an object? For example, Dim cls As New MyClass() cls.WriteLog("Hey")Where, 'MyClass' is the class that the function you posted above is in? You're not just trying to do MyClass.WriteLog("Hey")Are you?
  14. One option would be to write the HTML to a temporary file, and then navigate to that local file, rather than simply setting the innerhtml.
  15. Try changing it to this: Dim oWriter As New IO.StreamWriter(sFilePath, True) oWriter.WriteLine(sVal)I'm not sure exactly what File.AppendText does, but my way should work if you just want to append regular text.
  16. Hello all, I've created a tutorial to go along with the MenuIconProvider that is in the Code Library right now. Please look at that component to see the kind of things that this interface is useful for. Anyway, it's in Microsoft Word 2000 document form (if someone has the ability to turn this into a PDF or something like that, please do.) so you need some form of Word to read it. Anyway, it's about creating a component using the IExtenderProvider interface; it's kind of advanced, so I wouldn't recommend looking at it unless you have a very firm grasp on OOP and VB.NET as a language. As usual, PM bugs and comments to me. Enjoy. [edit]Opened in Word, saved as rtf. If something was lost, let me know.[/edit] iextenderprovider.zip
  17. D'oh, forgot the attachment. [edit]Updated attachment to include AssemblyInfo[/edit] menuiconprovider.zip
  18. Hey all, I've made a component in VB.NET (can be used in any .NET language though) to add icon bitmaps to your menus. It uses the IExtenderProvider interface built into the .NET framework. This interface allows for you to extend already existing controls on a form with a new property (well, it's actually a simulation of a property, but it works just as well), without having to inherit the control, or make a new class of any kind. What this particular component does, is extends your form's MenuItem components with an 'ImageIndex', and the extender component has an 'ImageList' property; it works quite similar to a toolbar. You bind an existing ImageList to the extender component, and you can give your MenuItems an image from the ImageList. To use it, simply drop it on the form, and the menus will be extended automatically. There is no coding involved at all, on your part. Please PM me any bugs you find, or any comments you may have about the component. I hope you enjoy it. To use this component Open the project that I have included in the ZIP file, and compile it into a new DLL. When you load up your Windows Forms project you wish to use this component in, right click on your toolbox, and click 'Customize Toolbox'. Make sure you are on the '.NET Components' tab, and click 'Browse'. Find the DLL you compiled from my class, and add it to your project (it is normally in <Your Projects Folder>\MenuIconProvider\bin\). You can now simply drop it on your form, and it's simple from there. Thanks to divil for the UITypeEditor class to allow for smart image selection, and to Derek Stone for finding me the code for parsing menu shortcuts. toolbox. You are now free to use it in your programs.
  19. Would you mind posting what the problem was and how you fixed it, just in case someone else happens to have the same problem in the future?
  20. In the properties window, click the little Lightning bolt icon. The properties list will change to an events list. Type the desired name of your event sub beside the event you want, and press enter. It will now add the event handler to your control.
  21. I don't think there is. You should read in the entire file into an array of lines, set the first element in the array to "", and then add a few elements to the array (using Redim). Once you're done that, create a String from the string array using myString = String.Join(fileArray, ControlChars.CrLf).Trim()Then, write that back to the file.
  22. You don't register the DLL with RegSvr32. They are not activeX DLLs. Simply add a reference to it in your project and you can use it.
  23. You changed it to Compile? The resource file? When I did that I got 108 build errors. :-\ Or are you talking about another file?
  24. Since it's a subclass, it will be compatible wherever a MenuItem is compatible.
  25. I would really recommend just creating a subclass of MenuItem by inheriting it. It's really not hard at all, and it's the best way. I had the same problem as you, and that's what I ended up doing. Made my life much easier.
×
×
  • Create New...