|
Thanks.
I devised it to encourage people to search CodeProject before asking
simple questions for which the answers are readily available...
|
|
|
|
|
Except it hasn't worked in this case
only two letters away from being an asset
|
|
|
|
|
Yeah, what would we do without simple questions ?
We would have to investigate the hard ones !?
|
|
|
|
|
Hi,
I am trying to insert selected items from a listbox into a label, the listbox is fillby a database query, the problem is all I get is this System.Data.DataRowView it works fine when I dont use a database query and just text in the listbox.
Cant anyone help on a solution for this??
Dim i As Integer<br />
For i = 0 To ListBoxUpgrade.Items.Count - 1<br />
If ListBoxUpgrade.Items(i) Then<br />
LabelSum.Text = LabelSum.Text & Space(6) & ListBoxUpgrade.SelectedItem(i) & vbCrLf<br />
End If<br />
Next i
Thanks in advance!
Stefan.
"All answers have a question? All code has an end."
|
|
|
|
|
I don't use VB very much but from what I know in C# if you use something like
ListBox1.SelectedItem[i] it would not work.
ListBox1.SelectedItem[i] returns a ListItem this one has a Text and a Value property.
I think you should use something like ListBoxUpgrade.SelectedItem(i).Text
Hope it helps...
Just call me Valy...
|
|
|
|
|
You must select a column index for the DataRowView. Try this:
<br />
for(int i=0; i<ListBoxUpgrade.Items.Count-1; i++) {<br />
if(ListBoxUpgrade.Items[i].IsSelected) {<br />
LabelSum.Text += " " + ((DataRowView)ListBoxUpgrade.SelectedItem[i])[yourIndex] + "\r\n";<br />
}<br />
}<br />
____________________________________
There is no proof for this sentence.
|
|
|
|
|
you would be better of posting this in the VB forum instead of the C# forum...
|
|
|
|
|
Thanks,
Sorry I thought I had!
My bad.
"All answers have a question? All code has an end."
|
|
|
|
|
no worries, if you browse long enough trhough CP you can tell the difference between people making a mistake and people just being lazy .
There is no bad in making a mistake, it makes us human .
|
|
|
|
|
Hi,
In windows application - I want the user to press a button
and while the button is pressed I will do something...
I tryed the mouse down event but it only doing it once
and I want to do the same function as long as the button is pressed (or the mouse button is down)
Thanks
dana Tov
|
|
|
|
|
On the mouse down event start a new thread that does the work. On the mouse up event signal the other thread to stop working.
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
"I wouldn't say boo to a goose. I'm not a coward, I just realise that it would be largely pointless."
Ready to Give up - Your help will be much appreciated.
My website
|
|
|
|
|
Thanks!!
Is there a way to do it in a single thread?
dana Tov
|
|
|
|
|
Hi,
a keyboard key has autorepeat, so it will generate multiple KeyDown and KeyPressed
events when you hold the key down. A mouse button does not.
If you need a repeat for the mouse button (or a faster repeat for a keyboard key)
you can use a Forms.Timer that runs all the time, and checks whether the ccndition
is satisfied (either key is down or mouse button is down).
For "key is down", set a variable lastKey to the key that is down in KeyDown,
and set it to Keys.None in KeyUp; for "mouse is down" use Control.MouseButtons
(there also is Control.ModifierKeys for CTRL/ALT/SHIFT).
|
|
|
|
|
Mouse down is a single thread event -TRUE
But you can use multi threading in it.
start a thread on mouse down and
stop it on mouse up
|
|
|
|
|
sam# wrote: start a thread on mouse down and
stop it on mouse up
Dejavue![^]
|
|
|
|
|
i am sorry!! i didn't see that Mr. Martin.
but it seems you are quite good in peeping other's reply
|
|
|
|
|
sam# wrote: i didn't see that
I assumed that.
I forgot to mark it as "Joke"
sam# wrote: Mr. Martin
Come on!
sam# wrote: but it seems you are quite good in peeping other's reply
Really???
|
|
|
|
|
|
you can do it using two events:
1. when mouse down
2. when mouse get off the button range
in step #1, you know that the mouse is down. in step #2 you know that the mouse left the button, then you can stop the thread you started in the first event!
|
|
|
|
|
Wondering if anyone can point me in the right direction, as a starting point, in building a frame accurate High Definition Video player i.e. must be able to control the HDV at the frame level. Have been spending time looking into various SDK's like WMV HD, DirectShow and DirextX with no clear concensus on the correct direction. Any pointers would be apprciated. Thanks
|
|
|
|
|
Hello ,
I have one class in C# which I need to post into messagequeue as an message.
I am using XmlMessageFormatter. Problem is the message posted in to message queue is in Ascii format not unicode. I need it to get posted in unicode format.
Can anyone help it out.
Though attributed my class as [StructLayout(LayoutKind.Sequential , CharSet=CharSet.Unicode)] it didn't work out.
Please suggest me.
thanks,
Sreedevi
-- modified at 8:15 Monday 9th July, 2007
|
|
|
|
|
Hi,
I have a list box with items in format:
1,1
1,2
1,3
..
2,1
2,2
..
Now i want to store the items in two different arrays how can i do that.
Regrads
Sangram
|
|
|
|
|
Hello,
Create two ArrayList's.
Iterate over the Items, split the item with ',' char.
Add the splitted results to the ArrayList's!
All the best,
Martin
|
|
|
|
|
Thanks...
Plz help me with a small code snippet as i am new to this
Regards
Sangram
|
|
|
|
|