Results 1 to 3 of 3

Thread: [RESOLVED] ToolStripTextBox Item With Label

  1. #1

    Thread Starter
    Master Of Orion ForumAccount's Avatar
    Join Date
    Jan 2009
    Location
    Canada
    Posts
    2,802

    Resolved [RESOLVED] ToolStripTextBox Item With Label

    You know when you right-click in an MS Access table and you see that context menu item with a "Filter For: [TextBox]"? (If you don't, it's basically a ToolStripTextBox item with a label infront of it.)

    Anyway, I am looking to duplicate this. I have a pretty good idea how to do it, however, I wanted to see first of all if anyone knows of an already made inherited class that does this. Anyone know if any vbforum users may have created this?

    Google hasn't really found anything good for me, so just thought I'd ask.

    If not, I'm think of repositioning/resizing the TextBox then using the Drawing.Graphics.DrawString() to draw the label.

  2. #2
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    26,413

    Re: ToolStripTextBox Item With Label

    heres an example that adds a datetimepicker to a toolstrip. you can modify it easily to add a custom control that has a label and a textbox.

    vb Code:
    1. Dim _deadlineDateTimePicker As New DateTimePicker()
    2. Dim _deadlineToolStripControlHost As New ToolStripControlHost(_deadlineDateTimePicker)
    3. _deadlineDateTimePicker.Width = 140
    4. ToolStrip1.SuspendLayout()
    5. ToolStrip1.Items.Add(_deadlineToolStripControlHost)
    6. 'add other controls here
    7. ToolStrip1.ResumeLayout()

  3. #3

    Thread Starter
    Master Of Orion ForumAccount's Avatar
    Join Date
    Jan 2009
    Location
    Canada
    Posts
    2,802

    Re: ToolStripTextBox Item With Label

    Had no idea it was that easy... and here I was writing an inherited class. Thanks.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width