|
Hello Gurus,
How can I display a thin and long popup tooltip whenever the users move the mouse over any cell of a DataGrid? Also the popup tooltip displays the contents of the cell that the mouse is being on top of it.
Thanks a lot in advance
Khang;)
|
|
|
|
|
I was wondering if anyone knows how to play a video with windows media player in C#. i got the player loaded onto my form but i cann't figure out how to tell it what video to play. any ideals ? thanks kevin
|
|
|
|
|
SetURL to your video file name.
eric feng
www.infospec.com
|
|
|
|
|
What url? where at?
|
|
|
|
|
Player.AutoStart = true;
Player.URL = "c:\movie.avi";
eric feng
www.infospec.com
|
|
|
|
|
Do a bit search on www.microsoft.com, you will find a good tutorial about how to use it in VB.Net, you can use the same code in c#.
Don't forget, that's Persian Gulf not Arabian gulf!
|
|
|
|
|
thanks that helped so much. what do you think i did before i posted this message? i searched for a good hour with out any luck on finding anything that made sense to me.
|
|
|
|
|
|
You need to check what version you are using becauce the commands changed completely between the two? If you have installed media player 9 it will over write the exiting componet the came with VS. Here is a sample of the older version which I think is the one that you have got!
private AxMediaPlayer.AxMediaPlayer VideoScreen;
VideoScreen = new AxMediaPlayer.AxMediaPlayer();
string FullPathAndFileName = @"C:\MyVideo.avi";
VideoScreen.FileName = FullPathAndFileName;
VideoScreen.Play();
Hope this helped
Leon v Wyk
|
|
|
|
|
just a quick question. With the StringBuilder class the individual chars are 'accessible through the Chars property'.
In C# are the two following equal then:
char c = myStringBuilder[x];
char c = myStringBuilder.Chars[x];
sorry if it's a stupid question, I'm just curious
|
|
|
|
|
Yes, the StringBuilder's indexers access the same array as the Chars property does.
"Blessed are the peacemakers, for they shall be called sons of God." - Jesus
"You must be the change you wish to see in the world." - Mahatma Gandhi
|
|
|
|
|
|
HI,
I need to have a non-breakable hyphen in Word Doc.Only way can do this, sending " CTRL + SHIFT + -" to the word document. How can i type this(send this)to the Word using c#? Or is there any other method?
Kanch
|
|
|
|
|
Assuming the Word document has focus, you can use the System.Windows.Forms.SendKeys class to send keystrokes to the application.
James
"I despise the city and much prefer being where a traffic jam means a line-up at McDonald's"
Me when telling a friend why I wouldn't want to live with him
|
|
|
|
|
As James T Johnson said, you can use SendKeys. But you can also find out the character code of a non-breaking hyphen, and use Word Automation to insert it.
"Blessed are the peacemakers, for they shall be called sons of God." - Jesus
"You must be the change you wish to see in the world." - Mahatma Gandhi
|
|
|
|
|
I found the uni-code for the non-breaking hyphen(2011). Having a hard time using it.
Since i have to string-catinate this command to another string, i can not use sendkey command, i guess.. I am not sure
Any suggestions, sample code would be a great help.
thanks...
Kanch
|
|
|
|
|
I created a DataGrid and DataTable in code. I set the DataSource of the DataGrid to be the DataTable.
How do I set the alignment of the displayed cell data?
I messed around with the DataGridColumnStyle.Alignment Property but that seemss to only adjust the alignment of the column header. I need to right align the entire column of numbers.
|
|
|
|
|
I use DataGridColumnStyle.Alignment and it works. May be You have extra spaces on right in Your numbers?
Hi,
AW
|
|
|
|
|
Hi
How can i find the position of each of the spaces in this string?
String duh = "Its a beautiful day in the neighborhood";<br />
int c = 0;<br />
char[] s = duh.ToCharArray();<br />
for(int i = 0; i < s.Length; i++)<br />
{<br />
if(s[i].ToString() == " ")<br />
{<br />
c++;<br />
Console.WriteLine(c);<br />
}<br />
}
This code finds the 6 spaces in the string, but i'm having a hard time getting the IndexOf location of each of these spaces.
Any help would be appreciated.
|
|
|
|
|
How about
string s = "It's a beautiful day in the neighborhood";
for (int index = 0; index < length(s); index++) {<br />
if (s[index] == ' ') {<br />
Console.WriteLine(index);<br />
}<br />
}
Cheers, Julian
Program Manager, C#
This posting is provided "AS IS" with no warranties, and confers no rights.
|
|
|
|
|
Welcome to CP Julian! Always good to have more Microsofties around.
Hawaian shirts and shorts work too in Summer.
People assume you're either a complete nut (in which case not a worthy target) or so damn good you don't need to worry about camouflage...
-Anna-Jayne Metcalfe on Paintballing
|
|
|
|
|
Thanks for your help on this. it worked as you said, except it's actually
index < s.Length;
also, i was using " " instead of ' ' as you did and i was getting a compilation error. i didn't think it mattered, but i was wrong.
Thanks again.
|
|
|
|
|
I should've added my usual clause:
(Code was written on the fly, probably won't compile.)
The difference between " " and ' ' is that the first is a string of length one, and the second is a single character. So you can't compare a character such as someString[i] to " " (they're two different types)
if (someString[i] == " ") { // won't compile
// blah
}
...but you can to ' ' (since they're both of type char)
if (someString[i] == ' ') { // will compile and do what you think
// blah
}
Cheers, Julian
Program Manager, C#
This posting is provided "AS IS" with no warranties, and confers no rights.
|
|
|
|
|
My cheap $0.02:
Option #1:
the same code you have up there, but put the value of i (when s[i] is equal to " ") in a collection (Hashtable, ArrayList, what have you).
Option #2:
use IndexOf(" ") and cut the starting part of the string every time...
string s1 = "Its a beautiful day to be coding";
string s2 = s1; //To save the original s1 if needed
Hashtable ht = new Hashtable(); //Use whatever you need instead of an hashtable
while(s2.Length>0)
{
int k = s2.IndexOf(" ");
if(k<0)
{
break; //No more spaces found
}//IF
ht.Add(ht.Count, k); //Save in ht the index where the next space is found
s2 = s2.Substr(k+1); //Cut away everything up to the space
}//WEND
//Disclaimer: I have not compiled nor tested this code
Maybe it could be better to use a StringBuilder
HTH,
Olorin
|
|
|
|
|
this works fairly well, I subtracted 1 from the for loop
because it prints out 33 for what would be the next space.
This is the output.
4
6
16
20
23
26
<br />
private void button1_Click(object sender, System.EventArgs e)<br />
{<br />
string str = "Its a beautiful day to be coding";<br />
string[] strs = str.Split( new char[]{' '} );<br />
int j = 0;<br />
int k = 0;<br />
for ( int i = 0; i < strs.Length - 1; i++ )<br />
{<br />
k = strs[i].Length + 1;<br />
Debug.WriteLine( k + j );<br />
j += strs[i].Length + 1;<br />
}<br />
}<br />
Bo Hunter
|
|
|
|