Jump to content
Xtreme .Net Talk

mutant

*Experts*
  • Posts

    1922
  • Joined

  • Last visited

Everything posted by mutant

  1. For me it all comes down to interoperability between languages and knowing excatly what happens in the code. How does using the "native" .NET methods over the legacy ones impede the productivity? Were they really that big and complicated that you could not replace it very few .NET calls? I can't really answer that question since my experience with VB6 was short, and lets just say not pleasant :), but I think you get my idea. As for interoperability, there just has to be some standard, and Microsoft should not encourage deviating from it. Since .NET gives us a beautiful way to combine languages, multiple people working with different sets of methods and coming from different language background, may cause confusion to one another. But on the other hand, if they stuck to using the regular methods, everybody is happy, and noone has to research additional methods while trying to maintain or change the other person's code. I personally don't think many people just use the regular .NET methods just to show how they have evolved over VB6 specifically. Programming has to evolve in general, and if it means I have to write two lines of code instead of one on rare occassions, I'll do it. The evolution over VB6 did happen though, and that cannot be denied, but it brought so many good things with it that I don't know how somebody could go back :).
  2. You can write your own, or just create a new project and copy the new file into your current one.
  3. You don't have to open the file when using the Open File Dialog. The dialog simply returns a filename, it is completely up to you to decide what to do with the file path.
  4. You are not enabling the depth buffer in presentation parameters. Look into EnableAutoDepthStencil and AutoDepthStencilFormat properties of present params.
  5. It might not exist if you don't reference the System.Drawing assembly.
  6. That is because DirectX uses different terms for those :).
  7. I would recommend creating your own collection class based on CollectionBase class. Post if you need help with that.
  8. Since you must use, as previously pointed out, a bad programming practice, here is an example for you. Dim scores(-1) As Integer Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click ReDim Preserve scores(scores.Length) scores(scores.Length - 1) = Integer.Parse(sc.Text) End Sub Please plead with your instructor to teach to use the tools provided with .NET properly! :)
  9. I'm not sure if I am understanding your problem correctly. What excatly are you trying to do? Splitting the text into characters and putting them into an array, or what? I'm not making much sense out of your problem.
  10. How is CSS going to substitute for a CMS? Am I missing something ? :)
  11. Here is an equivalent for you: The DirectCast call will convert the created object into a control for you. Dim ctrlname As String = "WindowsApplication1.myctrl" Dim asmb As System.Reflection.Assembly = System.Reflection.Assembly.GetExecutingAssembly() Dim ctrl As UserControl = DirectCast(asmb.CreateInstance(ctrlname, False), UserControl)
  12. Is that a sign of approval, or disagreement? :) ;)
  13. MyControl can simply be a base type for all other usercontrols he creates (or even cast it to a UserControl, it doesn't matter). Either way it works for what he seems to be requiring. Can't forget some level of abstraction :).
  14. As I see it this will work excatly the way you want, as suggested previously by marble_eater (assuming your controls are in the same assembly as your program): //Replace the hardcoded string with your string you get from db. string ctrlname = "WindowsApplication2.MyControl"; Assembly asmb = Assembly.GetExecutingAssembly(); MyControl myctrl = (MyControl)asmb.CreateInstance(ctrlname, false);
  15. You can use the Device.GetBackBuffer() method to get ahold of the backbuffer. As for chaning day and night, I don't really know about that with sprites since I never used this object myself. For example using 3d graphics would be able to do that in Direct3D just by changing the ambient color of the scene. I would have to check if it works on sprites.
  16. I don't get what everyone is having problems with :), but simple reflection work solves this problem (let's take a look at the button for example): //First we get the required assembly. Assembly btnassembly = Assembly.GetAssembly(typeof(System.Windows.Forms.Button)); //And then simply create the button. Button btn = (Button)btnassembly.CreateInstance("System.Windows.Forms.Button", false); Unless I'm missing something from your problem (and other posts), this should work on any assembly.
  17. Either initialize the variable with an initial value, or use the out parameters. I recommend you look through MSDN to check the differences between the two. int hello = 10; DoHello(ref hello);
  18. Im not talking about using PHP in specific. I'm just trying to point out that you can build a simple system for a website like that very easily without investing plenty of time. :)
  19. Pass the form instance into your UserControl as set it from there. That would be one other way.
  20. Depends on what you want to do with your site other than just posting tutorials. CMS for just posting tutorials is a bit of an overkill, and will probably take some time to customize it the way you want it (I speak from previous experience here :)). What I went with for the resurrection of my old website is a collection of simple PHP pages, that all include the basic layout file and then the page specific information. For example appropriate tutorial is chosen based on the value of a query string, and the file with the same name is included in the page. All of this required about 10 lines of PHP :). In the end you have to decide what else you would want to do with your website. RainbowPortal is a nice ASP.NET CMS.
  21. You have to use the form's AcceptButton property which specifies a control that respond to Enter. Then simply get the button from your usercontrol: this.AcceptButton = userControl11.Button1; [edit]Got beaten ;)[/edit]
  22. I can send those with no problem :confused:. Outlook Express similarly thinks that those can be malicious.
  23. Is WinForm the name of your form class, or does it reference a specific instance of your form? The latter is required to use that property since it is specific to each instance.
×
×
  • Create New...