|
|
I've noticed that 1st exceptions always take a while to be thrown to your program (at least with file ops anyway). Then any following exceptions are thrown immediately.
Does anyone know how to make 1st ones throw immediately?
Thanks - Gary.
|
|
|
|
|
You can't force it to throw "immediately". What kind of time are you talking about? What is your code doing? Are the file operations that your talking about on the local machine or remote, on a network share, or FTP, ...?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I have a listbox with a list of all 50 states. I want to know which state the preson has selected on in the listbox. It dosent matter if the program will instantly know and then act or if a button must be clicked adn the information is transfered into a string.
Help!
|
|
|
|
|
|
Listbox.SelectedItem.Text
|
|
|
|
|
Is this what you need?
Private Sub lstBox_Click()
str = lstBox.Text
End Sub
When listbox is selected, it will be handle by the Click event. To get the state selected use lstBox.Text .
<italic>Work hard, Work effectively.
|
|
|
|
|
This is what I think you are looking for.
Private Sub lstBox_Click()
str = lstBox.SelectedItem ' To get the currently select item in the Listbox
End Sub
|
|
|
|
|
Your looking for ListBox.SelectedItem
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
StateList is the ListBox with the states...
'Get the state selected in the StateList
Public Function GetSelectedState() As String
'Check if there's something selected
If StateList.SelectedIndex = -1 Then
'There's nothing selected
Return "No State Selected"
Else
'Return the selected state
Return StateList.SelectedItem.ToString
End If
End Function
and the SelectedIndex event is raised when the user selects a different state...
|
|
|
|
|
i'm from indonesia,
i wan't share my problem but my english not good...
my problem now that i can't take the color(with argb) from image in picturebox.image or picturebox.backcolor...
i hope somebody have an idea...
thanks
: : The Experience Is Te Best Teacher : :
Share Your Experience...
Thanks....
|
|
|
|
|
Is this[^] what you need?
<italic>Work hard, Work effectively.
|
|
|
|
|
i have a medical application. once the doctor selects a patient for consultation. there are a list of differnt diagnosis which can be selected multiple for a single patient at a time.Now each diagnosis has differnt findings and surgerys booked for the diagnosis.These findings are 40% common in all diagnosis and rest are differnt. Now there are around 20 diagnosis. my clinet wants to see the selected diagnosis findingson a findings form and surgery information for all selected in surgery form. i cannot make all the controls for differnt findingds on the same form a make visisble true false according to the selected. and making controls at runtime will be cumbersome.can any body tell me the flow to do this. any further information needed will be provided.
Thanks
Monica
|
|
|
|
|
Hope it helps
Dim UserControl As New YourControl
Me.Panel1.Controls.Clear()
UserControl.Location = New System.Drawing.Point(x, x) 'x - Specify your control location
UserControl.Name = "YourControl"
UserControl.Size = New System.Drawing.Size(x, x) 'x - Specify your control size
UserControl.TabIndex = 0
Me.Panel1.Controls.Add(UserControl)
|
|
|
|
|
User Control is only one example name.
Put another name.
First you must reference your control on the form.
In the solution explorer/References/Add references/Select your control
Then you must import your control:
Imports YourControl 'The name of your control
|
|
|
|
|
i know i am reffering my user control not this name(user Control) i have alos added the reference but ist not showing up when i use dim ctrl as new ___ i cannot find that in the list popup. what other way i can refrence. its in my project .
|
|
|
|
|
Verify if your control is Private.
It must be Public if it is a different project
|
|
|
|
|
its in the same project and how can i verify its public or private
|
|
|
|
|
On the first declaration of the class.
Private class YourControl
Change Private to Public
|
|
|
|
|
i may have many usercontrol in a standard exe . its not letting me change the control type to public. if i want to it says change the project to activex control but this is my project with other forms. so dio i have to make my controls in a differnt project. i am not getting it.
pls help
|
|
|
|
|
Now I know what's wrong
The code that I gave you is for Visual Basic .Net.
You must be running VB6.
I can't help you on that.
Sorry!
|
|
|
|
|
Hi,
I'm building a new app (vb6) and I need to open a .txt file and check if in the .txt file it exists a text expression.
How can I do that?
Thanks in advance.
|
|
|
|
|
Private Sub Get24Hours()
Dim strLine, strTmp() As String
Dim lngX As Long
Open App.path & "\REC24-032405120130.txt" For Input As #1
Do While Not EOF(1)
Line Input #1, strLine
strTmp = Split(Trim(strLine), ",")
If strTmp="Your Expression" Then
else
endif
lngX = lngX + 1
Loop
Close #1
Hope this will help
|
|
|
|
|
I am building a deployment project for my Visual Basic application, and I'm having some registry trouble. I'm using the Registry Edition in the IDE to create the registry keys, but a few of my keys include the full path to the application. Since the MSI installer lets to user install wherever they want (I can only recommend an installation location), how can I get full installation location so that I can update my registry keys? Do I have to do a custom action that runs once the installation is finished? Even so, how can I get the full installation path? Thanks.
|
|
|
|
|
You could put in a custom action to put the installation path into the registry.
It would be even easier to change your code to not care about getting that path from the registry. Instead, at runtime, you could use Application.StartupPath to find out where the .EXE was installed to. From there, you could make absolute, or relative, path names to any file that your application needed using the Path class and its .Combine() method.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|