Results 1 to 12 of 12

Thread: showing captions of childforms on combobox in vb.net 2010

  1. #1

    Thread Starter
    Hyperactive Member gaouser's Avatar
    Join Date
    Mar 2022
    Location
    Near the User32.dll
    Posts
    386

    showing captions of childforms on combobox in vb.net 2010

    how to show captions of childforms on combobox in vb.net 2010 (i have a android document selector for resize tool on mdiform)
    Basic page
    Text

  2. #2

    Thread Starter
    Hyperactive Member gaouser's Avatar
    Join Date
    Mar 2022
    Location
    Near the User32.dll
    Posts
    386

    Re: showing captions of childforms on combobox in vb.net 2010

    uhh no one replies so im gonna use textboxes
    Basic page
    Text

  3. #3
    Fanatic Member Peter Porter's Avatar
    Join Date
    Jul 2013
    Posts
    532

    Re: showing captions of childforms on combobox in vb.net 2010

    Quote Originally Posted by gaouser View Post
    uhh no one replies so im gonna use textboxes
    Gaouser, me and others tried to help you in your other threads, but you always wonder off doing other things!

    This is the last time I'm writing you. Also, don't send me cryptic private messages again!

  4. #4
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    25,464

    Re: showing captions of childforms on combobox in vb.net 2010


  5. #5

    Thread Starter
    Hyperactive Member gaouser's Avatar
    Join Date
    Mar 2022
    Location
    Near the User32.dll
    Posts
    386

    Re: showing captions of childforms on combobox in vb.net 2010

    dont send microsoft links because all of those c# microsoft isnt working with vb.net
    Basic page
    Text

  6. #6
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,299

    Re: showing captions of childforms on combobox in vb.net 2010

    Quote Originally Posted by gaouser View Post
    dont send microsoft links because all of those c# microsoft isnt working with vb.net
    You utter fool. You get to choose the language used for examples at the top of the page. Even if you couldn't, all the principles are the same so anyone putting just a little thought into it could apply those principles to either language. Most importantly though, where do you get off telling us what not to post when you refuse to listen to anyone telling you what we need you to post in order to help you. We want to help but you just waste our time by refusing to provide the required information, even when asked multiple times.

  7. #7

    Thread Starter
    Hyperactive Member gaouser's Avatar
    Join Date
    Mar 2022
    Location
    Near the User32.dll
    Posts
    386

    Re: showing captions of childforms on combobox in vb.net 2010

    my microsoft gets banned so i cant change
    Basic page
    Text

  8. #8
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,299

    Re: showing captions of childforms on combobox in vb.net 2010

    Quote Originally Posted by gaouser View Post
    my microsoft gets banned so i cant change
    That makes little to no sense, so it's like everything else you post. Why do I bother? I shan't any further.

  9. #9
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    25,464

    Re: showing captions of childforms on combobox in vb.net 2010

    An MDI form has a built in WindowList feature, which is a part of a menu item. The ms link I provided shows you how to implement a WindowList in a menu. As JM told you, that’s available in both c# and vb, but even if it wasn’t, the steps detailing creation of such a menu are the same, and you can run c# though a code converter with fairly accurate results…

  10. #10
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    25,464

    Re: showing captions of childforms on combobox in vb.net 2010

    It's simple enough to do as you originally wanted, but you need to run this code every time a form loads or closes...

    Code:
    ComboBox1.Items.Clear()
    ComboBox1.Items.AddRange(Array.ConvertAll(My.Application.OpenForms.Cast(Of Form).Except(New Form() {Me}).ToArray, Function(f) f.Text))

  11. #11

    Re: showing captions of childforms on combobox in vb.net 2010

    this is the most simple way but it works for me with a ComboBox1 name

    SOLUTION on 3 Basic STEPS:

    step 1.

    Declare a variable at the beginning of your form which will hold the original text value of the ComboBox. Example:

    Dim xCurrentTextValue as string
    step 2.

    Create the event combobox1 key down and Assign to xCurrentTextValue variable the current text of the combobox if any key diferrent than "ENTER" is pressed the combobox text value keeps the original text value

    Example:

    Private Sub ComboBox1_KeyDown(sender As Object, e As KeyEventArgs) Handles ComboBox1.KeyDown

    xCurrentTextValue = ComboBox1.Text

    If e.KeyCode <> Keys.Enter Then
    Me.ComboBox1.Text = xCmbItem
    End If

    End Sub
    step 3.

    Validate the when the combo text is changed if len(xcurrenttextvalue)> 0 or is different than nothing then the combobox1 takes the xcurrenttextvalue variable value

    Private Sub ComboBox1_TextChanged(sender As Object, e As EventArgs) Handles ComboBox1.TextChanged
    If Len(xCurrentTextValue) > 0 Then
    Me.ComboBox1.Text = xCurrentTextValue

    End If
    End Sub

  12. #12
    Smooth Moperator techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,532

    Re: showing captions of childforms on combobox in vb.net 2010

    1) That has nothing to do with the problem of this thread.
    2) That's not how you should be handling dropdowns.
    You should be adding values to it, then handling one - one... ONE - event - valuechanged event. that's it. Nothing more, nothing less. And it should not be setting the .Text of hte combobox... there's no reason for it.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

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