|
Both are collections.
But you have to provide the size of an array before you use it, may not be compulsory at the time of declaration.
But with an array list, you dont have to.
You use the add property to add on any number of items you want to.
eg ArrayList1.Add("Something"); if it is a string arraylist.
You might want to refer the msdn library for more.
Keshav Kamat
India
|
|
|
|
|
|
An array is a fixed size list or matrix with elements of a specific type.
Examples:
int[] primes = { 2, 3, 5, 7, 11, 13, 17, 19 };<br />
string[] chessPieces = new string[7,1];
An ArrayList is a dynamic list of objects. As any data type can be handled as the type Object, you can store anything in the list.
Example:
ArrayList items = new ArrayList();<br />
items.Add(42);<br />
items.Add("Answer");<br />
int answer = (int)items[0];<br />
string info = (string)items[1];
---
single minded; short sighted; long gone;
|
|
|
|
|
arraylist provide u functions to add,remove,insert etc.. items in the list..
while array didn't
|
|
|
|
|
Hello Everyone,
I want to open, play, pause and stop Mpeg files in WindowsMediaPlayer using Windows application.
I have added the wmp.dll(windowMediaPlayer dll) to the references. By using the WindowsMediaPlayer class, I am able to open the player
( this is how it is -
WindowsMediaPlayerClass wmPlayer = new WindowsMediaPlayerClass();
wmPlayer.openPlayer(@"C:\monkeydog.wmv"); )
, but I am not able to implement the Pause, Stop and fullscreen functionalities.
I tried these functionalities with - wmPlayer.controls.stop()and wmPlayer.controls.pause(), but this is not working fine.
Once the MediaPlayer starts, it nethier stops nor pauses.
Can someone help me out with this. Its quiet urgent.
Thanks..
Kraj
|
|
|
|
|
In order to control media playback using the Play, Pause, or Stop methods of the MediaElement control, the LoadedBehavior property must be set to Manual.
Check out here[^]
Keshav Kamat
India
|
|
|
|
|
How can I set this in C# windows application?
Can I set this through button properties.
Any alternative solutions?
|
|
|
|
|
kraj99 wrote: WindowsMediaPlayerClass wmPlayer = new WindowsMediaPlayerClass();
You should just be able to add the control to your form in the designer.
kraj99 wrote: wmPlayer.controls.stop()and wmPlayer.controls.pause(), but this is not working fine.
I've used the WMP control a lot, and those functions work fine for me. You probably need to post some code to try to work out what you're doing wrong.
kraj99 wrote: Its quiet urgent.
Aren't they all ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Below is the sample code. One more thing I want to mention here is that I am using a third party GUI software, so I wont be able to add WMP control on to the Window Form. I just need to control the WMPlayer by the code.
The below mentioned code is able to open the player. But the stop and close functionalities are not working.
public partial class Form1 : Form
{
private WindowsMediaPlayerClass wmPlayer = new WindowsMediaPlayerClass();
//private WindowsMediaPlayer wmPlayer = new WindowsMediaPlayer();
public Form1()
{
InitializeComponent();
}
private void Play_Click(object sender, EventArgs e)
{
wmPlayer.openPlayer(@"C:\SampleVideo.wmv");
}
private void Stop_Click(object sender, EventArgs e)
{
wmPlayer.close();
//wmPlayer.controls.stop();
}
}
thanks
|
|
|
|
|
Friends
I have a problem in datagrid. i want a value of a particular column and row.
suppose the row number is 6 and column number is 3.so how can i get the value of (6,3)??
Please help me ASAP.
Thanks.
|
|
|
|
|
there are lot of articles related to your topic Here[^].
BTW dont post the message with Urgent. pls post the message with the correct subject.
this is not good practice to make the subject as Urgent.
Regards,
Satips.
|
|
|
|
|
I am talking about windows application datagrid.
Not asp.net datagrid.
Thanks.
|
|
|
|
|
Test270307 wrote: I am talking about windows application datagrid.
Not asp.net datagrid.
You didn't specify that. How is anyone meant to give you accurate help if you don't tell them important information - especially as it is "urgent"
|
|
|
|
|
You may want to store the value of the datagrid[row][column] in a string.
For row 6, column 3, use the following line.
string myString = Datagrid1.Rows[6].Cells[3].Value;
Keshav Kamat
India
|
|
|
|
|
'System.Windows.Forms.DataGrid' does not contain a definition for 'Rows'
|
|
|
|
|
use
using System.Windows.Forms;
Keshav Kamat
India
|
|
|
|
|
See MSDN [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
you can do so..
by using the itemarray[](used for column) property of the datagrid
i-e datagrid1.rows[6].itemarray[3].value
hope it solves your problem
Nouman Bhatti
|
|
|
|
|
I want to modify/update xml, but i don't know which node or element going to be modify. So there should display whole xml file and it should be editable and then there should be save option.
please help me on this.
praveenkumar palla
|
|
|
|
|
Do you want do to this in a GUI or just console?
One easy way to handle an XML File is the XMLDocument Class.
Another way is to try the XMLReader class.
Just see what you need.
|
|
|
|
|
This is a GUI application(C#.net windows)
I tried in many ways but it is giving validation error
Thanks
praveen
praveenkumar Palla
|
|
|
|
|
Is the xml file valid for it selfe?
If so the XMLDocument Class is a little bit tricky, but it manage itselfs. With nodes oben close and the primitiv stuff. Another thing is that in runntime ther might occure symbols like "&" or other special symbols. For example you must wirite & in your xml file.
If this all is correct, and it doesn´t work please post the error message and the xml File or even the code.
|
|
|
|
|
Hello,
I'm developping using VS.NET/.NET 2.0 and my listView does not have the effects available on Vista listView.
Please help me with this.
Thanks.
|
|
|
|
|
Hi,
I want to filter the productID that starts with "MDF", so I use
bindingsource1.filter = "productID like 'MDF%'" (look like sql query), but it's not working.
Somebody could correct the code will be appreciated.
Thanks in advance.
It seem to be a solution or an answer.
|
|
|
|
|
Do you want a sql query for this?
if so then here it is
select fieldNames
This would select all/several fields from the table name where the productID begins with MDF%
You can use connection/command/dataReader accordingly depending upon the database you are using.
Keshav Kamat
India
|
|
|
|