Jump to content
Xtreme .Net Talk

divil

*Gurus*
  • Posts

    3026
  • Joined

  • Last visited

Everything posted by divil

  1. Did you forget to attach it?
  2. Can't you run it with a debugger on your target OS to find out where this occurs?
  3. Do you mean getting either the 32x32 or 16x16 version of an icon from the same icon file?
  4. You need to cast it to the correct type before you can access members of it, e.g. ((frmMain)this.MDIParent).Property = value;
  5. You need an instance of the form to be able to work with it. If you need to work with a form in a procedure in a module, you should pass the form to the procedure as one of the parameters. I wouldn't use a module at all, it's best to group similar procedures together as shared functions of a class instead.
  6. I am guessing perhaps some code in the handler for this event does something which causes the Click event to get called in turn.
  7. The function VolteFace posted is exactly what the VB.NET IsDate function does.
  8. Virtually nothing; it is holding references to the textbox objects, not the objects themselves.
  9. I'm afraid you've been led slightly astray - this is the closest you'll get to what you were originally trying to do: TextBox[] t = { textBox1, textBox2, textBox3 }; t[0].Text = "test 1"; t[1].Text = "test 2"; t[2].Text = "test 3";
  10. A stack overflow exception is pretty much only thrown when your code is recursing on itself infinitely. Check for any actions in your code which could fire an event that runs the same code, this will be the problem 99% of the time.
  11. You will need to inherit from a control (a panel control ideally) and enable the built in double-buffering. Do this using the protected method SetStyle. Then instead of drawing in the timer tick, invalidate the control instead and do all drawing in the Paint event of the panel. This will prevent any flickering.
  12. That is exactly what I suggested in my last post, having an array of textboxes.
  13. As this seems to be a FAQ here, I have developed a couple of components to do just this. I am not providing source code yet, but I may do in the future if there is a demand for it. Rather than attaching binaries here in the forum (which is not allowed), I am linking to a page specifically for the product on my site. Remember, as with all binaries, you download it at your own risk. DotNetWidgets Page
  14. You're quite right, the .NET one doesn't expand itself vertically when you insert linebreaks with autosize on. I wonder why. Here's a couple of tips though - firstly, don't ever use the upgrade wizard. It is a menace, and a waste of space. It teaches notoriously bad coding habits, and makes use of a special library for functions similar to VB6 ones when you should be rewriting in proper .NET code. Secondly, if you really need this behaviour you have all the power of GDI+ available for measuring and drawing text, you do not need to use a Label control to achieve the effect.
  15. The .NET label control supports multiline text just fine. If you tell it to autosize it will only base its size on one line of text though, how would it know what width it should be otherwise? This is how the VB6 one behaved too if I remember correctly.
  16. Don't confuse DOS commands with win32 console applications :) And if you want to ping something, you can do it from right within .net.
  17. Sorry, you can't do that. Closest you'll get is having an array of textboxes instead.
  18. I guess you would use a timer (or even Environment.TickCount) to record the time one frame, and make your program wait until the current time is over that plus 1000 / 30 (= 33) before continuing.
  19. What do you mean? The OpenFileDialog is just a component that you can add to your form at design time so you can change its properties.
  20. The .NET RichTextBox control supports portions of the text being read-only. Here's an example to show this: RichTextBox1.Text = "The quick brown horse jumps over the lazy fox." RichTextBox1.Text &= Environment.NewLine RichTextBox1.Text &= "This line will be editable, the first will not." RichTextBox1.SelectionStart = 0 RichTextBox1.SelectionLength = RichTextBox1.Text.IndexOf(ControlChars.Lf) RichTextBox1.SelectionProtected = True RichTextBox1.SelectionStart = RichTextBox1.Text.Length + 1 richTextBox1.Text = "The quick brown horse jumps over the lazy fox."; richTextBox1.Text += Environment.NewLine; richTextBox1.Text += "This line will be editable, the first will not."; richTextBox1.SelectionStart = 0; richTextBox1.SelectionLength = richTextBox1.Text.IndexOf("\n"); richTextBox1.SelectionProtected = true; richTextBox1.SelectionStart = richTextBox1.Text.Length + 1;
  21. I'm still not entirely clear on what you're trying to do here. If you're trying to store a reference to the text in a richtextbox, i.e. when you change your reference, the text in the richtextbox changes too, you can't. The String class is immutable.
  22. Check listview.SelectedItems.Count to see if anything or nothing is selected.
  23. You still haven't implemented the constructor, like I said. Public Sub New(ByVal tRichTextbox As richTextBox) richTextBox = tRichTextbox textLength = tRichTextbox.TextLength firstChar = 0 End Function
  24. Click on the little caret at the end of the link to be taken to the online MSDN version of it.
  25. Also, you have a load of useless form designer code which you should delete. You have mistaken the constructor in the C# example for a function, your RichTextPrintDocument function should actually be Sub New.
×
×
  • Create New...