Jump to content
Xtreme .Net Talk

divil

*Gurus*
  • Posts

    3026
  • Joined

  • Last visited

Everything posted by divil

  1. Yes - please see the FAQ posted as a sticky thread in the forum.
  2. Presumably if you're creating your application context you must be storing it somewhere, in which case you can pass it to your main form as it is created so it has a reference to it too.
  3. I don't think it's "retarted" at all. VB just happens to support one more layer than C# in terms of project-wide imports instead of having to declare them all in every file. Personally I think this is pretty useful, but like you said it can potentially cause problems when moving files between projects. For example in a large presentation layer it would be great to always import System.Windows.Forms, System.Drawing, System.ComponentModel without having to specify them every time like you do at the moment with C#. Mike_R: There is no such thing as having option strict off in C#. One of the reasons I like it :)
  4. The framework itself does fully support optional parameters, natively. It is C# that is lacking support for them. However this does not mean they are a good idea. The VB compiler does indeed compile in the default value of a parameter when calling the function. If you try writing a small method which takes optional parameters and disassembling it, you can see the default values and metadata associated with them. The best practice is generally accepted to be overloading functions, which essentially does the same thing anyway. For the above example, you declare another version of the function without a gravity parameter that calls the first function passing 9.8 or whatever.
  5. End is, however, not normally recommended as a good way of closing your application as it's good practice to clean up resources you are using explicitly. Closing the form your application is relying on for its message loop is generally a good idea instead.
  6. Check the user-agent header the browser passes to your site. If they're using internet explorer the version of .NET installed will be passed as part of this. You can then at least tell them that since they have .NET already they can download the smaller version. Those users that aren't using Internet Explorer (or just don't have .NET) you can still present with a choice.
  7. TabPages only have a Visible property because they inherit from Control. The TabControl uses it internally so that only the selected tab is visible, the rest are hidden. If the Visible property was changed to indicate tab visibility, how would it show/hide the different pages depending on which tab was selected?
  8. I have used LogonUser to impersonate a user with success. Why do you say you cannot do this?
  9. I suggest you go on using your third-party control then.
  10. The easiest way would be to derive from those classes in question, override the properties in question and apply the BrowsableAttribute to them.
  11. You cannot remove the property. You can hide it from the PropertyGrid by applying a Browsable(false) attribute to it in your derived class. You can hide it from the intellisense by apply an EditorBrowsable attribute to it in your derived class. You can stop its value being serialized by the designer by applying a DesignerSerializationVisibility attribute to it in your derived class.
  12. I suspect they're doing it by age, that would seem to confirm my suspicions.
  13. A more direct c# equivalent would be (x as ObjectType).DoWhatever();
  14. I'm pretty sure ASP.NET 2.0 outputs XHTML. Tables aren't "degraded".
  15. Maybe templates will be there to do this in Longhorn, since much of the Shell will be written in .NET by then.
  16. My Hotmail account grew to 250MB a long time ago.
  17. Do you need a hug?
  18. Not really, passing by value is the default for both. C# is a little more strict when it comes to reference parameters, though - it separates them in to "ref" and "out" parameters. Ref is standard passing a variable by reference, but out forces the procedure to explicitly assign to the parameter before leaving. Also, C# makes you specify "ref" and "out" when actually calling the method, too.
  19. TextBox t; // Method t = new TextBox(); Controls.Add(t); t.Bounds = new Rectangle(100, 100, 150, 25); // Other method string val = t.Text;
  20. What if I use them all the time, but it's also the name of my dog?
  21. He should really still put the code in the Dispose method. Microsoft has chosen to put this method in the .designer file which is hidden in VB (in C# it will be visible, I'm told). However you're still free to edit this file and I don't think the Dispose method gets re-written by designers so your code should remain intact. Also you don't have to click "show all files" to get there - you can just right-click the call to InitializeComponent and choose Go to Definition to load the file.
  22. Set the MaximizeBox property to false. This will stop the user maximizing the form in any way. This includes double-clicking the titlebar. I know you said you've tried it, but try it again now in a fresh project. That's the only property you have to set. If it doesn't work, there's something very wrong with your system or .net installation. Maybe you have some weird third-party software installed (WindowBlinds or something) that is overriding your UI.
  23. Tabbed document and SDI interfaces seem to be more popular these days. In fact, in the new Avalon framework, there is no MDI mechanism at all.
  24. What salary are you offering?
×
×
  • Create New...