Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 631581
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T19:58:53+00:00 2026-05-13T19:58:53+00:00

When the user selects a name in the listbox and clicks a button I

  • 0

When the user selects a name in the listbox and clicks a button I save the name in a var called “parent”.

What I want to do is programmatically move the selected name to the top of the list and take that whole list and drop it in a dropdown. I started the code below but don’t know how to move the selected list item (parent) to the top of the list??

Private Sub GoLower(ByVal parent As String, 
        ByVal lst As ListBox, 
        ByVal ddl As DropDownList) 

        ddl.Items.Clear() 

        For Each item As ListItem In lst.Items 
            ddl.Items.Add(item.Text) 
            'MOVE the item that is parent to top of ddl???? 
        Next 

End Sub
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T19:58:53+00:00Added an answer on May 13, 2026 at 7:58 pm

    Construct the list box in any order, then move the one you want to the top.
    This is in C#, but the VB.net equivalent should be obvious:

     ListItem item = list.SelectedItem;
     // or find the required item another way, such as .FindByValue
     list.Items.Remove(item);
     list.Items.InsertAt(0, item);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When a user selects the remember me function, I save his username and id
I have a TextBox (which shows notes). Now the user Selects his/her name and
When a user selects a file in a web page I want to be
I have a javascript tree, where user selects a tree node and clicks on
A user selects a portion of an image for a cut and paste operation.
The user selects a state from a drop-down field, then ajax posts that value
Suppose a user selects a file in a dialogue box, and the app then
Right now I use a ListBox but that allows the user to select an
We have an UI where user selects a department. It goes into a List
I have a ListBox (ListBox1) of Agency types {Police, Fire, Emergency} When the user

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.