Search results for query: *

  1. W

    Setting text in ComboBox, when style set as DropDownList

    I am interested in what jmcilhinney suggested. Can anyone provide code samples of how to inherit a control, and how to override the OnPaint Method?
  2. W

    Setting text in ComboBox, when style set as DropDownList

    Not sure why I never thought to sort the array myself and leave the ComboBox unsorted. This now works well for me. Thanks so much for your input.
  3. W

    Setting text in ComboBox, when style set as DropDownList

    It would appear that setting element 0 of my ComboBox to "(choose)" won't work because I need to have my ComboBox sorted. I don't want "(choose)" to show up anywhere else in the Drop-down list other than the very first item. Or am I missing something?
  4. W

    Setting text in ComboBox, when style set as DropDownList

    I have an issue that I've not yet been able to resolve. I've spent a couple weeks reviewing several forums and help sites and have not yet been able to get exactly what I need. I've had great luck in the past in this forum, and I'm hoping you all can help again. I need to be able to set the...
  5. W

    MeasureString help

    Thanks everyone for your help. It now works as I needed.
  6. W

    MeasureString help

    Thank you for the lengthy and helpful reply. Sadly, when using your code, I end up with the same output as what I originally had. What's confusing is that my textbox is 40 x 304, and the width of my test string is 326. How can that be? Here are the details: FONT - Microsoft Sans Serif...
  7. W

    MeasureString help

    I'm trying to find the best way to get the length of each line in a multi-line textbox. I'm trying to use , but I'm not having much luck. Does anyone have any examples of using MeasureString, using the returned value of the parameter? I just want to pass it the dimensions of my textbox and...
  8. W

    Max lines in a multi-line textbox

    Although this does work if you change the font to Courier New, there must be a more generic way to handle it, regardless of the font. Can anyone help with that? I'd like to keep my font Microsoft Sans Serif, if possible. Thanks!
  9. W

    Max lines in a multi-line textbox

    Sorry about the lack of formatting. I'll make note of it for future posts. After spending some time on it, I now have this working exactly as I want. I first had to change the font of my textbox to be Courier New, so every character was the same spacing. For my example, I had a textbox that...
  10. W

    Max lines in a multi-line textbox

    I did some searching an another form, and found this, which does mostly work. The only remaining issue I have is to disable wordwrap (which would allow a 3rd line of text in my example). Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) _...
  11. W

    Max lines in a multi-line textbox

    Is there a way to control the number of lines in a multi-line textbox. I want to have just one textbox and let it be only 2 lines max, but I need to allow the user to press "enter" to display text on the next line. Any thoughts?
  12. W

    Printing a form that has verical or horizontal scrollbars

    I have created forms that may have scrollbars on them, depending on what the user's screen resolution is set to. I already have existing logic that prints the forms just fine from my computer (with higher resolution and no scrollbars), but how do I ensure that when a "print" button is clicked...
  13. W

    Printing a popup form

    I had posted this in the general discussion, but I later found a forum specifically for forms, so I wanted to get people's input here. Through a bit of research, I've been able to figure out how to print an entire active form through the click of a button. Now what I'm trying to do is the...
  14. W

    Printing a popup form

    Through a bit of research, I've been able to figure out how to print an entire active form through the click of a button. Now what I'm trying to do is the following scenario: 1) Click a button on form A 2) Have that button click call form B, passing in some parameters 3) Have form B display...
Back
Top