|
I want to initial the value when loading a winform.
Actually , I do not know the Index of then combobox.
I only know the ID and the Name of the combobox item.
|
|
|
|
|
rushing wrote:
Actually , I do not know the Index of then combobox.
but how do you populate it ???
you fill it into the load event handler, then you know the indexes...
or i'm really out of your aim. is so, give a piece of code, otherwise i'll never can help you
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
I think this code does your request.
ComboBox1.SelectedIndex = 2
The other properties can not be used as a target of assignment
Ex:
ComboBox1.SelectedValue.ToString() = "choice2" 'Items of ComboBox1 :choice1,choice2..etc..
-MCP& MCAD &junior coder--
|
|
|
|
|
hakanaktan wrote:
ComboBox1.SelectedValue.ToString()
are you sure you can assign a constant that comes from ToString() ???
i don't believe.
Moreover, ValueMember does not contain only strings...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Here what i wrote:
The other properties can not be used as a target of assignment
Ex: (example for the expression at the upperside)
ComboBox1.SelectedValue.ToString() = "choice2" 'Items of ComboBox1 :choice1,choice2..etc..
-MCP& MCAD &junior coder--
|
|
|
|
|
yes but, why don't you write
ComboBox1.SelectedValue = "choice2"
instead of
ComboBox1.SelectedValue<font color=red>.ToString()</font> = "choice2"
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
I think it may be a bug of vs.net 2005 beta 1.
|
|
|
|
|
I hope this will help you
Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
Dim list As New ArrayList
With list
.Add("John")
.Add("James")
.Add("Jack")
.Add("Jimy")
.Add("Jombo")
.Add("Jimbo")
End With
End Sub
|
|
|
|
|
I use console.write("xxx") in my project.
But there is nothing in local output.
How to find the text?
vs.net 2005 beta 1.
|
|
|
|
|
The Output tab, although it's most common to use Trace.Write(xxx) to debug code.
|
|
|
|
|
There is some internal information in the output tab.
However, there is nothing about my output.
|
|
|
|
|
Console.Write() as its name says, writes into a cosole window.
the Visual Studio output window displays some debug informations, as it has been said to you already...
if you want to write text there anyway, replace your Console.Write() with Trace.Write()
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
The Trace.write() do not show text in output tab ,too.
|
|
|
|
|
|
There is only debug mode in vs.net 2005 beta 1.
|
|
|
|
|
don't know if you've solved this but use
debug.write("string")
then look in local
|
|
|
|
|
How do i pass a Class written in C++ into my VB project??
|
|
|
|
|
you must assure you that the class was not only written in C++ but in Managed C++ ! (unless you are not programming under VB .NET).
there, is the class encapsulated into a DLL or just into the exe ?
if it is in a DLL, did you think to add its reference in you project (and import its namespace if you like) ?
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
To import a excel file and display the records in spread sheet designer or data grid
|
|
|
|
|
Well I have done this using ADO recordset.. may this helps you
Dim sConn As String
Dim tmpRs as new Adodb.recordset
tmpRs.CursorLocation = ADODB.CursorLocationEnum.adUseClient
tmpRs.CursorType = 1
tmpRs.LockType = 1
sConn = "DRIVER=Microsoft Excel Driver (*.xls);" & "DBQ=" & txtPath.Text
tmpRs.Open("SELECT * FROM [" & cboSheetName.Text & "$]", sConn)
' txtPath is the path for the excel file....
' where cboSheetName.text is the sheetname within Excel file like sheet1
' or sheet2 etc
from here you have recordset and now you can do what ever you want...
|
|
|
|
|
hi, im just having trouble figuring out how 2 'print' or display text on a new line. i have ....
Text4.Text = "Tracing Route to " + Combo1.Text + ":" & vbCrLf & vbCrLf
and i need the stuff after 'combo.text1' : each to be displayed on the line beneath, as a list. any input would be MUCH appreciated!! thank u!
|
|
|
|
|
I guess you fotgot to change the property of a textbox... Multiline = true
just do this and your code is fine....
|
|
|
|
|
thank u VERY much !
|
|
|
|
|
How do you change a the sender's datasource (a datatable) from with a MouseDown event handler procedure.
I have a MouseDown event handler that needs to modify dataTables depending on who the sender is what their datasource is. How do you find out the dataSource of the sender and set a local datatable to that datasource. The datasource will always be a datatable.
Private Sub lstBox_MouseDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles lstUsedSoftware.MouseDown<br />
<br />
Dim dtRow As DataRow<br />
Dim index As Integer<br />
<br />
Dim lstBox as Listbox<br />
lstbox ctype(sender, ListBox)<br />
Dim dt as DataTable = ListBox.DataSource.GetType ?????<br />
<br />
<br />
If index > -1 Then<br />
lstBox.SetSelected(index, True)<br />
dtRow = dtUsedSoftware.Rows.Find(lstBox.SelectedValue)<br />
blha blah blah blah<br />
End If<br />
'End If<br />
End Sub
|
|
|
|
|
Hey all..
Let me start off by saying..I am a COMPLETE noob with VB and coding in VB in general , but would like to start learning...thus here I am asking questions...so bear with me as I request IN DEPTH and detailed information.
Ok...I would like to make a simple app that shows a user his INTERNAL and EXTERNAL Ip addresses, meaning his WEB IP ( router ) and INTERNAL IP ( network card ).
I would just like to make a bare bones simple app that looks something like this.
Internal IP = 192.168.0.1
External IP = 24.13.23.224
I am currently using Visual Studio.net 2003 for my coding...so anyone who can help with the code using studio.net 2003 would be greatly appreciated.
Also...I know its probably asking alot....but could you please explain how I would do it from ground up...step by step
(For example )
Step 1 READ THE FREEKIN MANUAL....lol
Step 2 Launch VB - Create a new project
Step 3 Name Form blah blah
Step 4 add this code
Step 5 save project
Step 6 build project
Step 7 Try out project and see if it works
Step 8 Leave me the hell alone...LMAO
Again...I am completely new to coding in VB, but have knowledge of BASIC and generalized coding...so I can atleast follow along...I DO know where the ANY key is...
Also...if you dont mind..can you please provide the code needed for EXIT...meaning..you create a menu on the top of your app...it has a FILE option that when clicked expands a drop down menu that I added EXIT to shut down the app...well...EXIT dont work with no code...lol
So All I need is the code for that...I can handle implementing that much.
Thank you VERY much ahead of time
Peace 4 now...4 NOW !
Gn.ßändï†ö¤CÏ5¤
[URL=http://www.ci5squad.com]Clan International Online[/URL]
[IMG]http://www.ci5squad.com/sigs/bandito.gif[/IMG]
|
|
|
|