|
private Sub DropDownList1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DropDownList1.SelectedIndexChanged
If DropDownList1.SelectedItem.Selected = True Then
Label3.Text = DropDownList1.SelectedItem.Text
End If
End Sub
here i don't see anything when i select 1st item
|
|
|
|
|
Don't check for the status of the Selected item. I take it your supporting only one selected item at a time. So don't check for the Selected property, you don't need it. Just use this:
Private Sub DropDownList1_SelectedIndexChanged( _
ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles DropDownList1.SelectedIndexChanged
' This will check to see if an Item is really selected...
If Not DropDownList1.SelectedItem Is Nothing Then
Label3.Text = DropDownList1.SelectedItem.Text
End If
End Sub
If the event that more than one item is selected, this code will return the selected item with the lowest index in the DropDownList Items collection.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
It waorks fine when i have dropdownlist with more then one item but when i select the first item from dropdownlist in this case only one item in dropdownlist .. still the same problem.
I am populating dropdownlist dynamically so don't know how many items will be in that dropdowmlist. i know it's going to be atleast one.
|
|
|
|
|
Then take out the if statement. This won't catch any errors and doesn't put any restrictions on what will be displayed.
Private Sub DropDownList1_SelectedIndexChanged( _
ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles DropDownList1.SelectedIndexChanged
Label3.Text = DropDownList1.SelectedItem.Text
End Sub
RageInTheMachine9532<font size="-1">
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome</font>
|
|
|
|
|
|
I have no idea what your doing wrong, because the same code works fine for me...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
(REVISED)
I am trying to do the following:
-Check each Point of a chart series to ensure it is within specific limits
-If Point is not in limit, change the Marker type of that Point
What my question is, how do you check specific Points in a series using VBA?
---------------------------------
After posting this question, I found out how to check the point values. I still cannot figure out how to change these individual Marker types to what I want.
Here is the code to check the values:
'***Checks series points, and colors them if need be<br />
Function RefreshPoints(ChartName)<br />
<br />
Dim nPts As Integer<br />
Dim aVals As Variant<br />
<br />
Worksheets(ChartName).ChartObjects(1).Activate<br />
<br />
With ActiveChart.SeriesCollection(1)<br />
nPts = .Points.Count<br />
aVals = .Values<br />
For iPts = 1 To nPts<br />
MsgBox aVals(iPts)<br />
Next iPts<br />
End With<br />
<br />
End Function
Can anyone tell me how to build on that above function to change the marker type of a single Point?
|
|
|
|
|
For those who care, I have solved my problem.. here is the final code:
'***Checks series points, and colors them if need be<br />
Function RefreshPoints(ChartName)<br />
<br />
Dim nPts As Integer<br />
Dim aVals As Variant<br />
<br />
Worksheets(ChartName).ChartObjects(1).Activate<br />
<br />
With ActiveChart.SeriesCollection(1)<br />
nPts = .Points.Count<br />
aVals = .Values<br />
For iPts = 1 To nPts<br />
.Points(iPts).MarkerBackgroundColorIndex = 35<br />
.Points(iPts).MarkerForegroundColorIndex = 1<br />
.Points(iPts).MarkerStyle = xlTriangle<br />
.Points(iPts).MarkerSize = 13<br />
.Points(iPts).Shadow = False<br />
Next iPts<br />
End With<br />
<br />
End Function
Now its just missing a few If statements to finish up, but thats what got it working. Just thought I'd post the code if anyone was interested.
|
|
|
|
|
When I use this code:
Dim pubsadapter As sqldataadapter = New sqldataadapter("select*from authors", pubssqlconn)
And Build It. the results gives me that sqldataadapter not defined.
I Imports the following before:
Imports System.Data
Imports System.Data.SqlClient
Thanks
Go forward and never Stop....
|
|
|
|
|
Then it should work. The lowercase spelling of the SqlDataAdapter name tells me that the Imports statements are incorrect somehow. They are spelled correctly, but possible not at the very top of the code file? They should normally come before any Namespace or Class statements.
You might want to try posting the code so we can see it?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Does it give any error at 'Imports' statement. VS.NET includes reference to System.Data.dll in most of the project templates. If we remove this reference to System.Data.dll, Imports will have no meaning. Imports is just to import the namespaces just for coding purpose but we still have to have a reference in the project.
BK
|
|
|
|
|
Hi.
Can anybody tell me if there is a way to move nodes within a TreeView? I have found how to use drag-and-drop between two different TreeViews but haven’t been able to figure out how to tweak the code to make it work within ONE TreeView.
I would like to be able to simply move child nodes (and parent, if possible) up and down in the Tree.
Thanks
Brad
|
|
|
|
|
Hi......
I'm a newbie here.
I have a question about how to input data from data grid control in Visual Basic.
I hope somebody can help me about this problem.
Thanks![Smile | :)](https://codeproject.global.ssl.fastly.net/script/Forums/Images/smiley_smile.gif)
|
|
|
|
|
Jakarta_Project wrote:
I have a question about how to input data from data grid control in Visual Basic.
And that question would be ..........???
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
You should Vsflexgrid to input direct data
tramdtt
|
|
|
|
|
hello guys...
It's our first semester here in our school and part of our 4th year standing here is to create our own information system. Can you suggest some systems except enrolment systems, election systems, point-of-sale systems, accounting systems, etc...
Thanks...
|
|
|
|
|
Bug tracking?
Timesheet analysis?
Expenses?
(And there are ASP.NET reference applications for all of these (www.asp.net[^])if you need some "inspiration")
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
|
|
|
|
|
Dear Sir,
Thanks for your suggestion... Good luck and Mabuhay...
len_ems
|
|
|
|
|
Hey All,
I have a simple quetion to ask.
The maxlength property of an edit box restricts user to enter more than the specified characters. But in the Japanese system, if user enters double-byte characters, then the actual byte would exceed that limit.
Do we have similar restriction on byte length as well?
I used LenB() method but it considers even the Ascii characters in the English language to be 2 bytes long.
e.g LenB("123") gives me 6.
So is there any generic function which would return me the exact bytes in a string (considering the 1 byte and 2 byte characters differently) and that can be used with English system and Japanese systems where user can enter Japanese as well as English character in the text box.
Thanks
Rohit
|
|
|
|
|
VB (6 at least - not sure about .NET) uses BSTRs to handle strings, which are always two bytes / char (AKAIK), with a couple at the front end for length...
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
|
|
|
|
|
All Strings in the .NET Framework are Unicode strings. They all have double-byte characters, so yes, "123" will return 6 bytes.
You can't have two different encodings in the same string. It's either going to be all single-byte, or all double-byte, not both...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I'm developing a simple scheduler application for my company in VB.NET (Windows Forms).
(No, I can't use a standard product due to reasons I can't go into here)
Anybody have any sample code or simple framework which can help me getting started so I don't have to start from scratch ?
I'm looking for some simple code which shows how to make different schedules (every hour/day/week/month/date, on fixed times/dates, etc)
I of course know how to make timers, services, execute stuff, UI, and the rest of the application - only need help for the shedule checking part.
Maybe some kind of simple class library...
TIA
/B
|
|
|
|
|
A simple search on Google for "Scheduler source code" revealed tons of examples:
Google search results[^]
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Ever seen the tab control on Windows messenger? I know that it is actually a web page but I got the idea of somehow turning it into a windows forms control. However, I got into a snag custom drawing the tabcontrol. I can't seem to resize it so that it has space to display an icon instead of text nor can I custom draw the tab itself, just the same old boring rectangle - not the cool, new curved tabs like messenger. Any ideas?
|
|
|
|
|
Hi
Is there a function that let me create a shortcut to an app?
say on the desktop?
Thanks
|
|
|
|