Highlight In Listboxes Without Permitting User Selection?

Jan 5, 2010

Is there a way to highlight an item in a VB.Net listbox without allowing the user to change selection?

When I set the selection Mode to "NONE" I canīt select an item in the code.
Same when I disable the listbox.

View 1 Replies


ADVERTISEMENT

Forms :: Move Selection Highlight (in E.g. A List, Grid..) Upon Right Click?

Sep 16, 2006

When we left click a grid cell, or list item, it highlights. Left click outside it and the selection jumps to the new place.

I can RIGHT click anywhere in the grid without disturbing an existing highlight, but I want it to work more like windows explorer would in terms of file selection..

i.e. if I right click inside the range, the range stays, if I right click outside the range, the range moves to a new single cell that I just right flicked.

Try it now on this page. Select some text, right click on the selection and it stays. Right click outside the selection and it goes. In datagrid (for example), the selection can only be modified with a left click.

How can we change this so the selection behaviour of a datagrid/list is more like this text pane?

On a related note. If I left click in a textbox I can drag a selection out. If i wanted to right click and drag the selection out, would it be the same process? (It's for a custom string manipulation picker control..)

View 3 Replies

Can User Copy Out Of Listboxes

Sep 16, 2009

I've got my first ever program and it's working. Having tested it a bit it would be helpful for the user to be able to copy the results printed in a listbox into an email or text doc. Just somewhere where they can make a note of it really.Is there something I need to do to enable it? All the google results I found were referring more to doing this in code. I literally want to be able to support Ctrl+A, the Ctrl+C straight out of the program to wherever the user wants.

View 4 Replies

User To Be Able To Highlight Text And Apply An Attribute?

Apr 2, 2009

So - I have some text in an RTF control. I want the user to be able to highlight text and apply an attribute. The following code is placed into a button called BOLD and seems to work nicely:

If rtfText.SelectedText.Length > 0 Then
rtfText.SelectionFont = New Font(rtfText.SelectionFont, FontStyle.Bold)
End If

The code above will turn the selected text bold.

But then the user selects the Same text and with the following code placed into a button called ITALIC it removes the bold attribute and replaces it with italics.

If rtfText.SelectedText.Length > 0 Then
rtfText.SelectionFont = New Font(rtfText.SelectionFont, FontStyle.Italic)
End If

Since the users actions are separate - I can not know that they want BOLD and ITALIC, so how do I make sure I keep the existing attribute on the selected text (which, by the way could be part bold and part not-bold) and add italic?

Somehow I need to add the italic attribute to the selected text, not simply replace all attributes with italic.

View 1 Replies

User Selects From Multiple Listboxes To Get A Price From A Price Array

Nov 25, 2011

I am new to vb and I am having so much trouble with this. What I need to do is this: I have a form application for winter sports equipment rental.I have a listbox filled with the equipment for the user to choose from then I have a combobox for the user to select the duration they would like to rent it. The book that I am using has no examples I can refrence and i have had no luck online either. I am posting what I have so far. However, i think I am going in the wrong direction. I have been working on this for so long that I think I have over thought it and made a mess of it. I am thinking that I need to add a new class for rentalRates then use enum of durationType and equipmentType but I am unsure how to move that way. That is using a enum, a 2d array and a parallel array? [code]

View 1 Replies

Limiting User Selection In ListBox

Apr 30, 2011

This program allows a user to select a workshop and a destination, only one selection should be made. When I test I find I can add multiple of the same.

Private Sub ListBox1_Validated(ByVal sender As Object, ByVal e As System.EventArgs) Handles ListBox1.Validated
If ListBox1.SelectedIndex = -1 Then
Beep()
MessageBox.Show("Select a workshop please.")
End If
[Code] .....

View 2 Replies

Outputting ComboBox User Selection?

Feb 3, 2009

I have a combo box that has multiple options, when the user selects one of the options (world wide city destinations) a specific value is assigned to a variable. For example if "New York" is selected the variable "x" is assigned the number 155. What I want to do is output the destination that has been selected ie "New York" in a label called "lblOutput1", do I need to store the destination as a seperate variable to be able to produce it in this label as I cannot seem to get it to work:

At the moment I am using:

lblOutput1.Text = "bla bla bla " + cmbDestination.SelectedText + " bla bla bla " + Today()

View 6 Replies

User List View Selection

Dec 20, 2011

I am using visual studio vb 2005 and I searched the forums for an answer to this but didn't find exactly what I was looking for. I am using the following code to populate a list box. What I want is to have a datagrid view show the results of a dataset that is generated when a user selects something from the list box. I know how to generate the dataset, but I'm not sure how to bind that to a datagrid view and I'm not sure what event I should use from the list box.[code]

View 6 Replies

C# - ASPxCombobox - Allow User Input And Dropdown Selection

Jul 9, 2010

I'm using devexpress ASPxComboBox, however I wanted to know how I can allow the user to enter values(in case it is not in the list) or choose from a dropdown list.

View 1 Replies

Cancel Form Closing By User Selection?

Jan 11, 2012

In a vb.net windows application, I need user to confirm before closing application. I have this code in FormClosing event

[Code]...

How can I cancel form closing if user clicked No?

Tried e.Cancel = false but it didn't work (exits application).

View 2 Replies

Change Text In Combobox When User Changes Selection?

Aug 19, 2011

I have a combobox on a form with the dropdownstyle set to drop down. Users can either salect a value from the list, or type in any value they wish. This all works fine. However, when one particular item in the list is selected I wish to set a different value. Unfortunately I don't appear to be able to set the combobox Text property from within any of the events that fire when the selected item is changed.

[Code]...

View 6 Replies

Force User To Make Combobox Selection?

Jun 30, 2011

I'd like to force a user to make a selection from a combobox.I've tried to test it by Combobox.SelectedText = String.empty as well as another version similar to this but a little different.When I test it, it will tell me that it is still unselected/blank even when I selected something.

View 4 Replies

Image Converting - User Selection For Type

Feb 21, 2009

I an working on image converting program. I need to convert a file that the user selects in an openfiledialog to the following file types in a folder that the user selects:
.ICO
.PNG
.JPEG
.BMP
.GIF
The user will select which type they want to convert the image to.

View 5 Replies

Load XML Document And Query Data On User Selection?

Feb 13, 2012

your life whatever you are doing.I have a big question. Well, it's a big job for me. I tried to google and follow some tutorials frist but finally realise rom stackoverflowers.I have a one big xml file such below. I have no control over its structure as it already exists with data.

<?xml version="1.0" encoding="utf-8" ?>
<root>
<Category Cat="A">

[code]....

View 1 Replies

Wpf - User Makes A Selection In One Of The Comboboxes - Selected Comboboxitem Gets Disabled?

Sep 30, 2011

In my program I've got several comboboxes that all have the same comboboxitems and when the user makes a selection in one of the comboboxes the selected comboboxitem gets disabled in the other comboboxes. (i.e. If the user has selected the comboboxitem with value 'a' in combobox #1 and selected the comboboxitem with value 'b' in combobox #2 then in remaining comboboxes both the comboboxitems with values 'a' and 'b' are disabled)

View 1 Replies

Asp.net - List Box Selected Index - Various Items Inserted Depending On The User Selection

Jan 18, 2012

I seem to be having issues with the selected index on a list box.

The list box is having various items inserted depending on the user selection. An example would be:

LiIndex = ListBox1.Items.Count
ListBox1.Items.Insert(LiIndex, "Item1")

LiIndex = ListBox1.Items.Count
ListBox1.Items.Insert(LiIndex, "AND")

[CODE]......................

This all work and displays without a problem. The issue I have is if I select the second of the two AND's. If I click the second "AND" in the list and then a button to fire a method, the selected index is always the index of the first "AND". Dim listIndex as integer = ListBox1.SelectedIndex

I can't work out why, the listbox itself will always show the second one as selected, but the action will happen against the first one.

View 2 Replies

Forms :: Clear The Dgv When The User Blanks The Combobox Without Necessarily Changing The Selection Index?

Oct 25, 2010

I have just realised that ComboBoxes don't have a Change event. I have a combobox filled with a few items, eg. Bakery, Deli, Fruit & Veg, etc. Choose one of these items, all the related items show in the dgv. However, when I blank the text in the Combobox (press Delete key whilst Combobox has the focus), what event fires so I can blank the dgv? The combobox does not contain a Blank item. Even if it does, the Blank item only fires the ComboBox1_SelectedIndexChanged when the user scrolls down to, or clicks on, the blank value.

I want to clear the dgv when the user blanks the combobox without necessarily changing the selection index.

View 3 Replies

Data Grid Selection Load Form - Call A Stored Procedure With The Value Of The Selection

Feb 27, 2009

I am trying have a data grid selection populate a form. I am new to this.Basically I have a connection persistance object and I would like to call that and call a stored procedure with the value of the selection. The datagrid is bound to an object.

[Code]...

View 1 Replies

Listbox (20 Items) With Multi-selection And Label That Disply The Selection And One Button

Dec 25, 2010

I have a listbox (20 Items) with multiselection and label that disply the selection and one button. So I wrote (it works fine)

[code]...

Now when I click on button the label show lets say Item2,Item5,Item10,How do I take off the last ","

somthing like that Item2,Item5,Item10

I used to do: Dim s As String = Trim(Label1.Text)Label1.Text = s.Substring(0, s.Length - 1) but it give me an error converting intiger to string

View 6 Replies

Office Automation :: Range(Selection, Selection.end(xlDown)).Select In .NET?

Jun 16, 2009

osheet.Range("A1").Select
'The line below is the one I would like to know how should I write it in VB.NET:
osheet.Range(Selection, Selection.end(xlDown)).Select

[code]......

View 3 Replies

Use Event Selectionchanged For DGV To Display "Contact Person" In TextBox2 BASED USER SELECTION In DGV

Apr 11, 2012

i have a DGV and 2 TextBox (the first one is for user input and the second is for displaying "Contact Person") in my Form. DGV DataSource is from database, i bind it programmatic with DataTable, the data is binding well, perfect, but when i use event Selectionchanged for DGV to display "Contact Person" in TextBox2 BASED USER SELECTION in DGV, it become error : "The Connection is already open" here is my code to bind data to DGV :

[Code]....

View 8 Replies

Folder Selection - Enable The User The Ability To Select A Folder And The Folders Music Files Populate A List Box

Jan 6, 2009

Basically I am trying to enable the user the ability to select a folder and the folders music files populate a list box. I want two list boxes on the page, one with all the contents of the folder and then the other one for files selected from the first box. I have no clue on how to do this at all...

View 4 Replies

File Selection Versus Folder Selection?

Aug 26, 2011

I am using this code to select a folder.how to do the same kind of thing selecting a file instead of an folder.

Private Sub PathButtonB_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PathButtonB.Click
Using FolderBrowserDialog As New FolderBrowserDialog
With FolderBrowserDialog
.Description = "Kies die Folder waar hierdie ResepteBoek die Kunswerke vir sy Resepte moet gaan soek."
.ShowNewFolderButton = False

[code]....

View 4 Replies

Visual Studio Macros: Loop Through Selection, Add .Append(" And ") To Each Line In Selection

Mar 18, 2010

Found this:

Sub SurroundWithAppendTag()
DTE.ActiveDocument.Selection.Text = ".Append(""" + DTE.ActiveDocument.Selection.Text + """)"
End Sub

But I can't seem to figure out how to loop through each line of text in the selection.

View 1 Replies

How To Use Listboxes O.0

Mar 19, 2012

I am creating a programme in which the user searches a file by typing into a textbox. if the search terms match anything in the file, it will be displayed in the list box. I understand this may be unclear so i will include an example:If the user enters "Oliver" into the textbox, the programme will search the file for any records that include "Oliver".The records are stored in structures:[code]The user will then click the desired record (several may appear)how would i get the integer and perform simple addition and subtractions on it?

View 10 Replies

.Net Listboxes Audio?

Nov 8, 2011

i keep getting this very wierd problem were i put in audio into my forms and (Design) but when i put in a 4'th song, it stops working and comes up with a error. I havn't limited my audio to how much songs i can play but for some reason it just stops playing them. This code below is the code i use for this form

Public Class Form1

[Code]...

View 7 Replies

Comparing 2 Listboxes?

Nov 15, 2011

First my prog scan a specific path "C:music" which contain Mp3. Then it takes the MD5# of all mp3 and put it in a listbox1. Also on the formload it does open a ".txt" which also contain MD5# that goes into listbox2.Now this is what i am looking to have :When i click my button it compare each line of my listbox1 to listbox2. If , for exemple , the first line of listbox1 is already in the listbox2 then it delete the first line of listbox1 (listbox1.items.removeat(0)). And Do until listbox1.items.count = "0".

View 2 Replies

For Each Statement With Listboxes?

Feb 17, 2009

i am generating a listbox from a txt file this list box has ip's in and what im trying to do is run a for each statement

for each item in listbox.items
me.query()
next

this is what the query() is

Try
Dim UdpClient As New UdpClient()
UdpClient.Connect("my ip in here", 2005)

[code]....

this is the same code i used for my last app to populate a list box?

View 2 Replies

Get 2 / More Listboxes To Play Together?

Jun 2, 2010

I have a program I'm trying to put together to allow my employees to submit shift reports. I'm doing this simply to make my life a little easier as this way, they will all be formatted the same. Instead of spending a large chunk of my afternoon thumbing through a bunch of differently formatted reports.

One feature that I need to figure out requires that one listbox can see what another is doing. Here, let me try to explain..

I have one list box that keeps track of EVERY action the employee does on a customers account. (cancel, upgrade, downgrade) and then a hidden listbox that JUST tracks "cancel" actions..one for "upgrade" actions and one for "downgrade" actions.

The reason behind that is that in the shift report, the all need to be listed separately. This way, I can just add each list to it's own array and list them where I need to.

The problem I've run into... If an employee handles an "upgrade" action at the beginning of the day..and then later on the upgrade is canceled, I can easily remove it from the main listbox that shows everything, however, I can't figure out how to find it in it's own listbox. The "Upgrade" box.

View 11 Replies

Getting 2 Listboxes To Work Together?

Jun 2, 2010

I have a program I'm trying to put together to allow my employees to submit shift reports. I'm doing this simply to make my life a little easier as this way, they will all be formatted the same. Instead of spending a large chunk of my afternoon thumbing through a bunch of differently formatted reports.

One feature that I need to figure out requires that one listbox can see what another is doing. Here, let me try to explain.I have one list box that keeps track of EVERY action the employee does on a customers account. (cancel, upgrade, downgrade) and then a hidden listbox that JUST tracks "cancel" actions..one for "upgrade" actions and one for "downgrade" actions.

The reason behind that is that in the shift report, the all need to be listed separately. This way, I can just add each list to it's own array and list them where I need to.The problem I've run into... If an employee handles an "upgrade" action at the beginning of the day..and then later on the upgrade is canceled, I can easily remove it from the main listbox that shows everything, however, I can't figure out how to find it in it's own listbox. The "Upgrade" box.

So unfortunately, on the shift report, it's still there even though it's gone in the program as far as the employee can see.The item in the main listbox doesn't have the same index as the item in each individual list boxes so I can't just tell it to remove the item at the same index..

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved