![year.png](/attachments/small/3/7e8a738796e0d938dcd6d9512b905f5f.png "align-right") first take a look at attachment pic to get a idea. I have two dropDownLists.1st dropDownList ID is cboPrev(oPrev) and 2nd dropDownList ID is cboNext(oNext). These both DropDownList will have the following 4 items (2014, 2015, 2016, 2017). User can click on dropdownlist and pick a year. # problem: # so for default item on dropDownList is "2014" but when user click on "2016" than the default first item is still "2014" - which is wrong # What I want: # So for default item on dropDownList is "2014" but when user click on "2016" than the default …

Member Avatar
Member Avatar
+0 forum 1

could anyone tell me how to dynamically select an item in a listview?? i tried `listview.setSelection(1);` and `listview.performItemClick(listview,3,listview.getItemIdAtPosition(3));` both of them don't work..please help me.

Member Avatar
Member Avatar
+0 forum 1

Hi everyone! I'm making an application which requires users with different permissions/previleges to login and use the application.For example, if the user is "admin", all menu items in the menu bar are shown and enabled. If the user is say "user_group1", some of the menu items are to be hidden. The same for "user_group2", "user_group3", "user_group4" and so on. I could put a code for each specific user in each form but that's a great deal since users and their user groups may be added after application deployment. So it has to be something flexible. I want the user "Administrator" …

Member Avatar
Member Avatar
+0 forum 21

hi all, I have a piece of code, I can delete the first value but fails and give notice InvalidArgument=Value of '0' is not valid for 'index'. Parameter name: index Private Sub ComboBox1_KeyDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles ComboBox1.KeyDown If ComboBox1.Items.Count > 0 Then If e.KeyCode = Keys.Delete Then ComboBox1.Items.Remove(ComboBox1.SelectedItem) 'or 'ComboBox1.Items.RemoveAt(ComboBox1.SelectedIndex) End If End If End Sub thank help !

Member Avatar
Member Avatar
+0 forum 3

I have a radio button and a listbox. After clicking on the radiobutton, a collection of items will be added into the listbox. I'm trying to go back to the collection I've started working on to edit a System.Collections.Specialized.StringCollection, but after running the program, the list of items has not updated. How would I fix this? Here is the code I have: Private Sub RB_Teacher_1_CheckedChanged(sender As Object, e As EventArgs) Handles RB_Teacher_1.CheckedChanged 'Displays Teacher Colleciton If RB_Teacher_1.Checked = True Then 'Clearazation of all previous items For Each item As String In My.Settings.TeacherCollection ListBox1.Items.Remove(item) Next 'Initialization of the required component informaiton …

Member Avatar
Member Avatar
+0 forum 3

I created a custom 'text menu' that should print each String passed to it. This is the class: package com.github.geodox.areacalculator.menu; public class Menu { private static int index = 0; private static String[] menuItems; public void addItem(String menuItem) { menuItems = new String[index+1]; menuItems[index] = menuItem; index++; } public void printMenu() { for(String menuItem : menuItems) { System.out.println(menuItem); } } } This is what is passed. Menu menu = new Menu(); menu.addItem("rectangle"); menu.addItem("square"); menu.addItem("circle"); menu.addItem("triangle"); menu.addItem("trapezoid"); menu.addItem("parallelogram"); menu.printMenu(); However, this is what is printed: null null null null null parallelogram Any ideas on why this is happenning?

Member Avatar
Member Avatar
+0 forum 3

I have a list box, with an item "Math". When I click on the Math item, I want a new collection of items to be added to the listbox after removing the current Math item, and make a back button to appear to return Math item back in case I need to go back. I was able to do that, but after I click on the back button and click on the Math item again, the previous collection of items is added to the previously added collection, so I get repeats. I can't figure out how to clear the "MathDep" …

Member Avatar
Member Avatar
+0 forum 2

I'm trying to select items from the listbox when pressing Enter on the selected item. Here is what I have tried so far: Private Sub ListBox1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles ListBox1.KeyDown Select Case e.KeyCode Case Keys.Enter ListBox1.SelectedItem = ListBox1.PerformMouseClick() End Select End Sub

Member Avatar
Member Avatar
+0 forum 1

I need to make one statement to select either of the items in listbox and show the same label, regardless of which item is selected. I've tried someting like If Me.ListBox1.SelectedItem = "R115" Or "Bay, Charles" Then Label1.Text = "Address Information Avaliable" End If But it doesn't work. The code below works but I need to make it shorter. If Me.ListBox1.SelectedItem = "R115" Or Me.ListBox1.SelectedItem = "Bay, Charles" Then Label1.Text = "Address Information Avaliable" End If Any suggestions?

Member Avatar
Member Avatar
+0 forum 2

I am trying to implement an item class to add items to rooms in a game in BlueJ. However in the Room class the addItem method is not working because of a problem with the "items.add". I have no idea what I am doing wrong. public class Room { private String description; private HashMap<String, Room> exits; // stores exits of this room. private ArrayList<Item> items; /** * Create a room described "description". Initially, it has * no exits. "description" is something like "a kitchen" or * "an open court yard". * @param description The room's description. */ public Room(String description) …

Member Avatar
Member Avatar
+0 forum 8

Hi all, I really need your help on this one. I have a MSSQL db table with two columns-ID and name. Each row in this two columns contains an unique ID and a name. Now I have a query that imports just a name in the listview (I don't want ID value in listview). I've put all the values from "ID" column in an array. Now what I want to do is that when listview item is clicked, the program recongnizes listview selected item index and gets a unique ID (I will need this ID to structure another sql query, …

Member Avatar
Member Avatar
+0 forum 3

Hi guys, I am trying to change color of the existing items in my listbox. Can somebody please help?

Member Avatar
Member Avatar
+0 forum 2

Hi, i am trying to edit a list box item in a way that if certain item is already present it should update it and if item is not present then it should add it to a list box what should i do Detailed i have a dynamic button which is associated with the products in product table that mean i would be having as much buttons as products i have now on click event i want to add them to a list box in the same cenerio as i explained above here's my logic and code i have added …

Member Avatar
Member Avatar
+0 forum 2

Windows Application Form: I have a problem with filtering winform datagridview by listbox items (multiselect). For example: My listbox items have guest name of 'Lim', 'Jack' and 'May'. I would like to filter my gridview data by these 3 guests. Which each guest has their own entry. This is my code and it does not work. Thanks switch (cbField.SelectedIndex) { case 0: Filter = ""; break; case 1: string FilterStart = "GUEST like '%"; string FilterMiddle = ""; string FilterEnd = "%'"; for (int i = 0; i < lbSearch.Items.Count; i++) { string[] filterEntry = new string[lbSearch.Items.Count]; filterEntry[i] = src.searchreplace(lbSearch.Items[i].ToString()); …

Member Avatar
Member Avatar
+0 forum 1

Form1 is a pop out windows from Form2. Form1 has a listbox1 with items and when I clicked the 'Continue' button in Form1, it will pass all the items in the listbox1 to listbox2 which is located in Form2. I would like to ask how the button_click in Form1 will pass the listbox1's items to Form2's listbox2. Thanks

Member Avatar
Member Avatar
+0 forum 4

Hello Community, I'm trying to dynamically add a menuitem to my context menu and add a click handler but for some reason it won't add the handler what did a do wrong? Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click For Each Line In RichTextBox1.Lines Dim NewItem As New MenuItem NewItem.Text = Line AddHandler NewItem.Click, AddressOf NewItem_Click ContextMenuStrip1.Items.Add(Line) Next End Sub Private Sub NewItem_Click(sender As Object, e As EventArgs) MsgBox(CType(sender, MenuItem).Text) End Sub

Member Avatar
Member Avatar
+0 forum 3

Not sure what I am doing wrong but let me try to explain my issue. I have a single combobox on my form that I use to load external settings. If I load, lets say, 100 settings in to this combobox then I clear the combobox via Combobox1.items.clear(), then try to reload a different set of settings that has a far less overall count, the combobox will not load the items and the dropdownlist will be massive but blank. NOW, if I load the settings that have far less then clear and load the settings with significantly more settings, then …

Member Avatar
Member Avatar
+0 forum 2

I am trying to create a drop down menu using UL and LI elements. Each LI is an image (of same size) and there are no Bullets in the List. In IE, the list Items are left-aligned as I want them. In Chrome the list Items are right aligned with a lot of space on the left. The CSS Code is .menuBar { background:url('./images/SideMenu/MenuTable_Bg.jpg'); margin-left:0; padding-left:0; text-align:left; } .menubar UL { list-style-type: none; text-align:left; } .menuBar LI { padding-top:5px; padding-bottom:5px; cursor: hand; padding-left:0; margin-left:0; text-align:left; } How do I get the images to left-align in Chrome ? I have included …

Member Avatar
Member Avatar
+0 forum 5

Can someone tell me how to add an additional item to a combobox that is bound to a datatable? I have populated the ComboBox with data from table sSQLCbo = "SELECT region.ID, region.name FROM [STORES] ORDER BY store.ID" Dim ds As New DataSet da = New OleDb.OleDbDataAdapter(sSQLCbo, con) da.Fill(dt) con.Close() ComboBox1.DisplayMember = "Region" ComboBox1.ValueMember = "id" ComboBox1.DataSource = dt Now I want to add an additional item "All Regions" so I can use this as part of a future query using the ComboBox SelectedIndexChanged.

Member Avatar
Member Avatar
+0 forum 3

i have a listview with subitems namely NAME Age and Position. The positions are Driver, Conductor and Inspector. I have 3 textbox namely CountD, CountC, CountI. What i want is if i Click the Name in the listview where the position is driver, the CountD.text will display 1 and if i Click another name in the listview where the position is also driver, the CountD.text will display 2 and so on. Also in other two texboxes where there position is Conductor and Inspector. HELP ME PLEASE GODBLESS

Member Avatar
Member Avatar
+0 forum 4

Please help, I have a small application which has a MS Access as backend, and the front end is developed using VB.Net 2008. When I click on the listview item and then click delete button to delete a particula list and its content on the database, it is giving me the error as "No value given for one or more required parameters". Please check my code below and help. FYI - My access database have a Primary key as the first character of the firstname combined with the first 2 characters of the lastname. It does not have a Anutonumber …

Member Avatar
Member Avatar
+0 forum 7

I want to control an external program from Delphi, so I spawn a process using CreateProcess. Based on ideas I adopted from Neil Rubenking, I then create a menu tree using TTreeView. The items in this tree are clickable, and clicks can also be emulated by me sending keyboard events (menu shortcuts) to the external application. So far all is good. I now want to set up the external program to run in batch. One way that the external program communicates with the user to inform that it is ready for new input is by flashing info to screen, but …

Member Avatar
Member Avatar
+0 forum 1

Dim mm As New SqlClient.SqlConnection("Data Source=.\SQLEXPRESS;AttachDbFilename=Integrated Security=True;Connect Timeout=30;User Instance=True") mm.Open() Dim mm1 As New SqlDataAdapter("select * from Area_type order by Area_name", mm) Dim ds As New DataSet mmm1.Fill(ds) With ComboBox1 .DataSource = ds.Tables(0) .DisplayMember = "Area_name" .ValueMember = "Area_name" .SelectedIndex = 0 End With mm.Close() 'hi i am student and what do i now for bind other combobox1 with combobbox2 help of above code????' 'below code fill textbox to combobox3 Selected item what i do plz give full code with detail thanx' Dim mm1 As New SqlClient.SqlConnection("Data Source=.\SQLEXPRESS;AttachDbFilename=;Integrated Security=True;Connect Timeout=30;User Instance=True") mm.Open() Dim mm2 As New SqlDataAdapter("select * from Add_Book …

Member Avatar
+0 forum 0

Hi all, I've been using this type of code to pull out a single value from my SQL database but I can't help thinking that there's a simple command I'm not using: [CODE] strSQL = "SELECT MAX(Stage) FROM Visits WHERE ScheduleRef = 22" FinalStage = dl.getPRISMdata(strSQL).Tables(0).Rows(0).Item(0)[/CODE] [CODE]Public Function getPRISMdata(ByVal strSQL As String) As DataSet Dim conn As New SqlConnection(ConnectionStringPRISM) Dim ds As New DataSet conn.Open() Dim da As New SqlDataAdapter(strSQL, ConnectionStringPRISM) da.Fill(ds) Return ds End Function[/CODE] It's the tables(0).rows(0).item(0) that bothers me. It works, but should I be doing something different here? Something more efficient in the function perhaps? Thanks!

Member Avatar
Member Avatar
+0 forum 2

Ok I have a project and I pretty much have no idea what I'm doing. Our project is to make some simplified POS software, in our case, for a restaurant. The form I am currently working on is where you pick food items and add them to a listbox which will essentially be the order form. I made a database in Access that has food-item info and linked it to the VB project. [URL=http://imageshack.us/photo/my-images/812/image1af.jpg/][IMG=http://img812.imageshack.us/img812/1971/image1af.th.jpg][/IMG][/URL] My combobox narrows down the food items according to what category is selected, i.e. "Lunch". Now.. is there any way I can select an item from …

Member Avatar
Member Avatar
+0 forum 1

Hi, I would like some insigth or help on the following issue that i am facing. I am building an empty validation module. where i validate my bound item whether they are empty or or not before save. I have a tab control with the said bound items. The thing is i could iterate through them and check them but it seem if the page is not visible or have been click it will not be considered and it will always return empty. [CODE] 'Get the original tab page index XtraTabPageIndex = FrmMain.XtraTabControl1.SelectedTabPageIndex 'Get the controls in the Main Form …

Member Avatar
+0 forum 0

[code]//This is the coding that I have done in delete item private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) { // TODO add your handling code here int selectedIndex = jList1.getSelectedIndex(); jList1.remove(selectedIndex); }[/code] its throwing following Exception [code=text]xception in thread "AWT-EventQueue-0" java.lang.ArrayIndexOutOfBoundsException: Array index out of range: 1 at java.awt.Container.remove(Container.java:1132) at musicplayer.jButton2ActionPerformed(musicplayer.java:144) at musicplayer.access$100(musicplayer.java:23) at musicplayer$3.actionPerformed(musicplayer.java:63) at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995) at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318) at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387) at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242) at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236) at java.awt.Component.processMouseEvent(Component.java:6041) at javax.swing.JComponent.processMouseEvent(JComponent.java:3265) at java.awt.Component.processEvent(Component.java:5806) at java.awt.Container.processEvent(Container.java:2058) at java.awt.Component.dispatchEventImpl(Component.java:4413) at java.awt.Container.dispatchEventImpl(Container.java:2116) at java.awt.Component.dispatchEvent(Component.java:4243) at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4322) at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3986) at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3916) at java.awt.Container.dispatchEventImpl(Container.java:2102) at java.awt.Window.dispatchEventImpl(Window.java:2440) at java.awt.Component.dispatchEvent(Component.java:4243) at java.awt.EventQueue.dispatchEvent(EventQueue.java:599) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160) …

Member Avatar
Member Avatar
+0 forum 5

I am looking for the a simplest for of code where I can add some items to a listview. i have 4 text boxes and 4 columns in a listview.. what could be the code to put 4 values as a single row in list view.. i managed to put put first textbox value as listviewitem (the first column) , but rest 3 has to be added as subitems... i am stuck here..

Member Avatar
Member Avatar
+0 forum 3

hi all, here my problem is i'm preety new to vb.net programming. but have a little knowledge in vb6 programming. Say, when i press the 'edit' button a listview is shown, filled with records('empcode' field from empdetail) from a access table, say 'empdetail'. now if i doubleclick on a particuler record in the listview, then the listview will disappear and the records will be displayed in the textboxes. exactly what we do in vb6, the coding follows,cn is the connection to the db. [code] private sub listview1_dblclick() for i=1 to listview1.listitems.count if listview1.listitems(i).selected=true then dim rs as new adodb.recordset rs.cursorlocation=aduseclient …

Member Avatar
Member Avatar
+0 forum 7

i want to make auto generated item number look like this item001 item002 and so on when i saved the item001 the next time i try to input new item it will give me item002 and so on... Thank You. i am using ACCESS

Member Avatar
Member Avatar
+0 forum 4

The End.