Jump to content
Xtreme .Net Talk

snarfblam

Leaders
  • Posts

    2156
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by snarfblam

  1. No such limitation. Simply put, it is a free product, though I'm having a surprisingly difficult time finding the terms of use.
  2. I would say that when you override a method and need a call to the base method you would usually add your code after the call to the base method. Your code might depend on initialization done in the base method, even if it isn't initially obvious.
  3. Naturally, two minutes after I've made a post saying I don't know the answer, I think I've found it. This solution might be tricky if you aren't at all experienced with coding designers. Not surprisingly, the TabControl uses a custom designer, System.Windows.Forms.TabControlDesigner, found in System.Design.dll. This designer class overrides the Designer.InitializeNewComponent() method, which is apparently only called the first time a component is added to a form. This is the method where those two initial tab pages are added. So what you would need to do is create a designer for your control (if you haven't already) by inheriting the System.Windows.Forms.Design.ControlDesigner (the System.Windows.Forms.Design.ParentControlDesigner might be more appropriate, but I'm not sure since I haven't spent much time getting my hands dirty with designers). Specify your designer class as your control's designer using the System.ComponentModel.Designer attribute (if you haven't already). Then override the InitializeNewComponent() method (if you haven't already) and add your default "pages" there. Just for the record, I haven't tested this.
  4. I would love to help you but I've been stumped by this same problem in the past an have never found a solution.
  5. Well here's an interesting update: almost a month later, my VB Express decided to unregister itself. Again, the registration code I've saved does not work. I sure would be mad if I had paid for these products.
  6. I know this doesn't directly answer the already answered question, but you ought to take a closer look at VB.NET code. At a glance it probably seems drastically different from C#, but the only major difference between the two is that where C# uses symbols, VB uses keywords. Upon closer examination VB will probably seem self-explanatory and pulling the concepts from VB examples should be pretty easy. Just something to keep in mind down the road.
  7. I don't think that this can generally be done via a for each loop. Unless you create your own class that references the CheckedListBox and can track/update its own checked status, and then populate the CheckedListBox with these, this can't be done. The problem is that a for each loop iterates through the items that you've added. Typically this is some sort of simple value like a simple string or integer, which, of course, don't expose the functionality to examine their status in any list-type control that may contain them. With the for each loop you are using, what you are asking for is impossible. Do you have a compelling reason to prefer a for each loop over a for next loop?
  8. I had an issue (now resolved), and I'm just curious to see if anyone else has had the same issue. I've been using C# Express for quite a long time now (you just can't argue with the price), but a few weeks ago my installation suddenly wasn't registered, which was quite peculiar since I remembered registering it. In fact, I saved my registration code in a text file, because I do that, so I had my registration code which proves that I did indeed register it. So I put the registration code into the "Register This Product" window and it rejects it. So I go to log into Microsoft's website, and apparently my account has ceased to be. I don't know if Passport accounts didn't carry over to Live, or what, but the account I registered C# with was gone. Is this problem unique to me?
  9. IL Merge. Or ILMerge. Or IlMerge. Not sure about the casing and the spacing, but anyways, its actually made by Microsoft. You can download it from Microsoft (though it might be one of those downloads where you need to have a Windows authentication plug-in installed and have no prior convictions for thought-crimes).
  10. Keep in mind that with that last code listing you won't be able to use event syntax (AddHandler, RemoveHandler). Also, with events in VB, you don't need to check them for null (Nothing) before raising them--VB does that for you. [Color=Green]'This code will also work [/Color][Color=Blue]Public Class[/Color] Test [Color=Blue]Public Event [/Color]OnMouseActivity [Color=Blue]As[/Color] MouseEventHandler [Color=Blue]Public Sub[/Color] MySub() [Color=Green]'You won't get a NullReferenceException here just because there is no handler [/Color] [Color=Blue]RaiseEvent [/Color]OnMouseActivity([Color=Blue]Me[/color], [Color=Blue]New [/Color]MouseEventHandler(MouseButtons.Left, 0, 0, 0, 0)) [Color=Blue] End Sub End Class[/Color] [Color=Green]'Now we can also use AddHandler/RemoveHandler[/Color][/Code]
  11. Re: Encryption doesn't rely on obfuscation georgepatotk, I think we all understand your position and your frustration, but with something as important as security, whether it is a dongle that provides job security or a client's social security number, the most important thing you can possibly do is research. As you've come to find, a nifty security scheme is useless if you don't meticulously identify and eliminate holes in the security. It's unfortunate, and a hard way to learn an important lesson, and I don't deny that Microsoft should have done more to make the potential problem appearent, but in the end the responsibility ultimately falls to you. We certainly can't blame you for venting, though.
  12. Just for the record, the only time that try/catch/finally will ever really slow things down is when errors are thrown, and even then you have to throw massive quantities of exceptions before it becomes a concern.
  13. This isn't a bug. This is actually by design. Any blank space below the last line of text in a RichTextBox handles the mouse as though it were the last line. For an example, open WordPad, maximize it, type in some text not followed by a carrige return, and then drag the mouse accross the empty space at the bottom. It will select the text as though you dragged the cursor accross the text.
  14. I don't know what, exactly, is going on under the hood with the Image.FromStream method. If you say it performs better, I'll take your word for it, but there may be considerations other than performance. My particular concern would be that unnecessary large memory allocations would be made (they might not be, I don't know), which can wreak havoc on the GC. You might want to see if you can get a better idea of what Image.FromStream does (check documentation or look under the hood with reflector). Just my two cents.
  15. Have you tried using the Graphics.CopyFromScreen method? (Assuming you are using DotNet 2.0).
  16. This seems like the simplest solution to me: If you do a google search on a given image format you can easily discover where within the file the image dimensions can be found. You could then open an image with a stream and use a BinaryReader to read the image size. You would have to write code to handle each image format, though.
  17. I personally wouldn't recommend this technique. It would probably work, but it prevents the login form from being properly disposed and might cause obscure errors or problems down the road. Multiple forms like this should be managed with the Application class. The simplest way to do this would probably be to duplicate the Application.Run in your Main() and specify the second form. The login data should probably be stored in your Program class or passed on to your main form. Your main should probably look something like this: /// <summary> /// The main entry point for the application. /// </summary> [sTAThread] static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); login loginForm = new login(); Application.Run(new loginForm()); // Place code to manage login data here Application.Run(new main()); // (or whatever your main form's class is called) }
  18. In both cases you are using it as an object. The difference is that in the first case you are creating a new object three times and in the second case you are re-using the same object three times. What is happening is this: when you use the default constructor for Random, it uses the time as a seed (this way the seed is essentially random). When you run your first code listing the code is executing faster than the computer's clock updates so you are getting the first number from the same list of random numbers three times. With the second code listing, you are getting the first three numbers from the list of random numbers once. In fact, if you ran the second code listing immediately after the first, you would see that the first number from the second code listing would match all of the numbers from the first listing.
  19. Re: DrawImage Oh, I see. Guess I didn't read your last post so well. When you use the Bitmap.GetHdc function, the Hdc is write-only. GDI+ bitmaps can be written to with GDI but not read from. To use GDI you would probably need to load the bitmaps via GDI instead of GDI+. I don't know how to do this since my experience with GDI is mostly limited to VB6 where I could actually use VB to load the bitmaps and then GDI to blit them.
  20. Re: DrawImage If speed is important then GDI+ is not your friend. Don't get me wrong... I use GDI+ all the time, but when performance is an issue I've resorted to GDI and even (in extreme cases) written my own blitters. From the look of things you seem like you know your way around GDI, so that would be my recommendation.
  21. In C# the designer automatically inserts a call to InitializeComponent in the constructor, which goes in the user code rather than the designer code, so you notice right off the bat if it isn't there. I know that in VB the constructor is hidden in the designer code, so not only is it a pain to fix, but you probably won't even ever catch it. The designer is probably just not smart enough to insert the call to InitializeComponent unless you use PD's method. (The attribute you used probably clued the designer in and caused it to insert the call to InitializeComponent.)
  22. I don't really know my WPM for either QWERTY or Dvorak, but I'm still pretty slow with the Dvorak layout, especially since I'm out of practice. It is actually surprisingly easy to jump back and fourth between the two. I have a cheap keyboard that I moved the keys around on. It really didn't help me much (though it could help you, who knows). It's strange, but I find it easier to type when I'm looking at neither the screen nor the keyboard. It must distract my visual cortex (or some junk like that).
  23. Link (this is padding to shut up vB).
  24. You could make this much, much faster by examining the raw image data rather than using the GetPixel method. I'll see if I can find the tutorial I wrote on the topic.
  25. I appreciate the effort, but the reason I only looped the animation four times was so that it didn't drive anyone insane while they are trying to use the forum. Also, don't use Dvorak unless you are healthy enough for typing activity. (HAHA! Get it? It's a JOKE!) But, again, thanks anyways. Here, have a smiley. :) And, mskeel, I am using a Dvorak keyboard layout right now, as I type. My advice? Yes, total immersion is ideal with a couple of exceptions. At this point I simply can not program with the Dvorak keyboard. It is too cumbersome and I can't maintain my train of thought. To make matters worse, in addition to the letters being moved, the punctuation is different too. Also, I do feel the need for a break from Dvorak now and then.
×
×
  • Create New...