i have a very simple problem but i can't figure how to fix it.I'll explain, i have 3 array named "Auto, Legumes, Films". I i making a function so whenever the selecteditem of the combobox change(Auto, Legumes or Films) the name of the selecteditem is passed to a function. The function use this name to display the items of the corresponding table in a listbox.The 3 different item name in the combobox match the name of the 3 tables, so i want to be able to re-use the name dynamically in my function.
Code where i call the function:
Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cbchoix.SelectedIndexChanged
The case is that I have two comboboxes (country and state) and a simple code to populate the state combobox accordingly depending on the selected country. Ok this is simple and easy, and this code is within the country combo change event.The case is that I have more than one pairs of those comboboxes and I wouldnt like to repeat all the populate code into every country combo change event.Actually I would like to have only one function and just call it passing as parameter a reference to the combobox I want to populate. Then I could use that reference into the function.
I have a ComboBox filled with a custom Class called TableHeader, this class contains two propertys, TableName and TableText, i have set the ToString() funktion to return TableText since its what i want to display but how do i get the TableName returned?
i want to limit how many times can user select the every items inside the combobox to 60. how could i do that? here's my code in my combobox.. i dont know how to start the codes in limiting.. that' why i dont have codes for that.
strsql = "select * from Schedulings where Sections = '" & ComboBox1.Text & "'" Dim acscmd As New OleDb.OleDbCommand acscmd.CommandText = strsql acscmd.Connection = asconn
I am using a dataset on the server, in this dataset I have a datatable that calls a stored procedure and returns column names from three tables. I call this stored procedure using a web service.i manage to show all the column names in my combobox but when I want to click a button and insert selected column name into a richtextbox I get System.Data.DataRowView in the textbox instead.
My code:
'the combobox 'if I don't have this textblock all the values are shown vertical instead of the normal horizontal lines 'the stored procedure SELECT COLUMN_NAME
[code]....
how to get the selected text in the combobox to the richtextbox?
Basically the application I'm creating has a login screen with two textboxes and one ComboBox... Once the user enters their first and last time for the first time it'll be stored in the combobox's index..Now my issue is this... Originally before I implemented the combobox the related user file name would be:"C:FicheStatsJohn SmithJanuary" + Ttbox1.text + Textbox2.text + ".txt"So basically the user filename would be JohnSmith.textBut now I want the user to directly select from the combobox and that the file name remains the same without space.... but in the combobox the name appears as John Smith.>
I have a form on which I have a datagridview, when I right click the grid a contextmenu popsup, when I click a menu item I can edit the item from the datagridview in another form. On that other form I have several textboxes and a combobox. The comboxbox contains several items and compares the item from the grid and shows the right item in the combobox. The thing I am trying to do is when I change the s
Private Sub TitleComboBox_SelectedIndexChanged(sender As Object, e As System.EventArgs) Handles TitleComboBox.SelectedIndexChanged Dim selectindex As String = TitleComboBox.SelectedItem
I have a combox box on my login form which contains 1 and 2, I use it as so called accesslevel. Now, my problem is that only the selected item will get read. If I type 1 or 2, it won't get read. How do I make it possible for both selected and written ones to be read?
I'm using VB 2008 express to create a windows form application. I have a combobox named cb_face. The items in the combobox are image file names populated from my resource folder using a "for each" loop. When an item is selected I would like to display the image in picturebox1. I have tried several different codes but none of them display the image. I am not getting any errors. The comment lines show some of the code that has been tried.
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim ImgFolder As New IO.DirectoryInfo("C:Documents and SettingsubdMy DocumentsVisual Studio 2008ProjectsBlank OutBlank OutResources") Dim ImgFile As IO.FileInfo() = ImgFolder.GetFiles("*.bmp") Dim info As IO.FileInfo For Each info In ImgFile [Code] .....
i have a form with one combobox and textbox now on other hand i have a sql database named balance with two column one as customername and and another as obbalance now i had binded all the customer name to the combobox now what i have to do is wen user selects a customer name from the combobox the textbox should show the obbalance of the selected customername here the customer name will not be repeated only one name with a customer
My question is, the SelectedItem property of the Combobox is supposed to return a integer value, is it not? Because I am getting back integers, sometimes, then the next time through I get back a String. Has anyone else had a problem like this with the Combobox?
I am new to VB environment. I am using Visual Studio 2005.In certain code, I need to add 4000 elements to the ComboBox list.
Using the command ComboBox1.Items.Add() seems ridiculous.
I am thinking of creating EXCEL File, in which I will put all the names in 1 column and call that excel File, when "dropdown" of combo box is clicked. how this will happen?? code related to this? or if this issue has already been discussed then plz give me the link for the same If this is not good idea like putting 4000 elements, then can there be any other solution?
Dim Length As Byte Length = 10 Dim Chars As Char() = New Char() {"a"c, "b"c, "c"c, "d"c, "e"c, "f"c, _
[code]....
is the above bolded line a correct .. it s not working too and the above code is used to generate a random password for users which should be displayed on the text box?
I am having a problem figuring this out. The text that is bold is where the problem is.
Imports Microsoft.Win32 Console.WriteLine(WMILookup("Win32_Bios","SerialNu mber")) Private Function WMILookup(ByVal WMIClass as String,ByVal WMIItem as String) As String
I have a .aspx webform, with code behind to handle data entered by user, most fields are in double.At business layer, at other class, let say there is a function: [code]I just wondering whether this is the correct way of writing it? And if I have more than 20 fields of double value, then I should declare additional 20 double value?
I have a function that search database based on the 2 textbox value. I have a difficulty to call the function and pass the text box value to the function. This is my function: So I get this error: {"Object reference not set to an instance of an object."}
Function getname(ByVal SearchedName As String, ByVal SearchedFirstName As String) As String Dim temp As New System.Data.SqlClient.SqlCommand Dim temp2 = "" Dim sSQL = " select SearchedName, SearchedFirstName from student where SearchedName =@SearchedName AND SearchedFirstName = @SearchedFirstName" [Code] .....
I have function in my asp.net/vb application with following signature:Public Function ExtractText(node As XmlNode) As String..I want to call it/pass xmlnode. How to create an Xml node with value:<mynode Id="7743" Type="context" StartNode="4356" EndNode="1234"></mynode>
I have one problem solved, properly converting text to numbers. Now I want to use that conversion as a selection parameter in a FillBy statement.I have two comboboxes linked to an Access 2007 database. One box lists the names of the States in the US. This is what I used for the Table Adapter Configuration Wizard for the combobox "State". [code] ST_UID is an Integer. I created a label with a bound value to STATE.ST_UID so that when a user selects the name of a state from the State box the appropriate ST_UID populates the label, (i.e, California has an ST_UID = 5). The problem is when a state is selected, I only want the Counties for that state to appear in the County box, i.e, COUNTY.ST_UID = 5 if California is the selected state. [code] Problem is I'm not getting any results, the "County" combobox is blank. I've tried a lot of variations on the code, such as % StUID %, etc., but no luck. I have experience with VB 6 but am a beginner with .NET.
pass an array to a function, like the code below shows
Private Sub SomeFunction(ByVal PassedArray() As String) For i As Integer = 0 To PassedArray.Count - 1 Debug.WriteLine(PassedArray(i))
[code]....
But is there a way to pass a constant array to a function in VB .Net, for instance in PHP you could write
function SomeFunction($array) { for($i=0;$i<count($array);$i++) {
[code]....
So to reiterate: Is there any way to pass a constant array directly to a function in VB .Net? Is there any benefit in doing so? I imagine a few bytes of memory could be spared.
PS.SomeFunction({"some", "array", "member"}) ' this obviously gives a syntax error
It looks like passing a list's enumerator to a function "byval" is quite different than passing it "byref". Essentially, regular "byval" passing will NOT change the caller's "enumerator.Current value", even if the function advances the enumerator. I was wondering if anyone knows why this is the case? Is an enumerator a primitive like an integer, without an object reference, and hence changes to it don't get reflected in the caller?This function is byval, and gets stuck in an infinite loop, spitting out "1" message boxes, because the enumerator's "current" never advances past 5.[code]The difference between the two functions is only whether the listFirstItem__ function accepts a byval or a byref enumerator.
I am trying to use a simple quicksort routine for a multidimensional array but cannot figure out the syntax. I am stumped because it works fine in VB6 but no luck in .Net
Array Declaration: Dim sArrIn(25000, 3) As String 'sort key (pkg, kitting, zip), kitting, data Function Call:
in the above statement val_length s a javascript function in tat function the first parameter shd b the contents of the text box ,the second parameter s a string type, is the statement correct i think it s wrong can u suggest a correct valid statement