|
In your example of using Queues, the operator "=" will do a reference assignment. Meaning, any changes to q2 will also show up in q1 and vice versa.
You will need to do explicit copying of the elements in order to duplicate the queues. Or you can do something like this:
q2 = new Queue( q1 );
This will do the duplicating for you.
Hope this helps,
Nathan
---------------------------
Hmmm... what's a signature?
|
|
|
|
|
Thanks, now is clear about reference assignment.
Also thanks for pointing me in using this kind of constructor, which will do for me exactly what I want.
But one more question: if the content of the queues is different, at the moment of assignment, one of it will be lost, right?
Regards,
Miguel
|
|
|
|
|
Don Miguel wrote:
But one more question: if the content of the queues is different, at the moment of assignment, one of it will be lost, right?
Correct, when the assignment to q2 happens with the constructor method the data in q2 is effectively lost (atleast if you don't have references to the elements in q2 somewhere else).
q2 = new Queue( q1 );
<br />
foreach( object o in q1 )<br />
q2.Enqueue( o );
Hope this helps,
Nathan
---------------------------
Hmmm... what's a signature?
|
|
|
|
|
Nathan Blomquist wrote:
the data in q2 is effectively lost
Thanks Nathan, is clear now.
|
|
|
|
|
Hi:
I would like to add DirectX reference to the C# project.I installed the DirectX9.0 SDK(for c#) already, but still not can find the DiretX reference. without that, i can not use namespace of DirectX, so can not continue work.
any boday have idea how to do?
thanks
henry
|
|
|
|
|
Project->Add Reference...
Select Microsoft.DirectX and any useful component parts (eg. Microsoft.DirectX.DirectDraw).
Paul
We all will feed the worms and trees So don't be shy - Queens of the Stone Age, Mosquito Song
|
|
|
|
|
Thanks. but the problem is I can not find Microsoft.DirectX and related component.
|
|
|
|
|
Hi:
I would like to add DirectX reference to the C# project.I installed the DirectX9.0 SDK(for c#) already, but still not can find the DiretX reference. without that, i can not use namespace of DirectX, so can not continue work.
any boday have idea how to do?
thanks
henry
|
|
|
|
|
Henry:
At the risk of sounding ignorant, have you searched the COM tab in the Add Reference dialog?
Craig
"If your ship doesn't come in, sometimes you have to swim out to it" - Audrey Quock
|
|
|
|
|
yes. I did search on the COM tab, only have directX for VB, not DirectX for c#. The more strange thing is after I downloaded and installed SDK9.0 for C#, all the api are c++.the label of downloaded component is C#,but why the code and API of that is c++?
do u have any idea?
thanks a lot
henry
|
|
|
|
|
henrykao wrote:
yes. I did search on the COM tab
If you want your project to be able to access "Managed DirectX", then you'll have to search for Microsoft.DirectX.< DirectX Component > under the .NET tab.
henrykao wrote:
only have directX for VB, not DirectX for c#.
Those libraries under the COM tab are for Visual Basic 6, but you can use them with VB.NET or C# ( both VB.NET and C# both would require an Interop dll which would be created by visual studio once you add the reference )
henrykao wrote:
the label of downloaded component is C#,but why the code and API of that is c++?
Unfortunatly, 95% of the documentation you download from Microsoft for DirectX will be in c++, but if you search hard enough you will find some VB documentation inside the C++ help files (especially for DirectShow). On the plus side, the directx objects for C++ and VB are similar and work basically the same way. The C# code is in the SDK directory in the samples folder.
Hope that's of some help to you.
Daniel E. Blanchard
|
|
|
|
|
My English is very poor,I hope you can help me.
How to make the window's(child) default status is maximize.
Thank You!
海纳百川,有容乃大
壁立千仞,无欲则刚
|
|
|
|
|
In you project you have created two forms.
Form1 -- this is your MDIParent form
Form2 -- your child base form.
In the properties for Form2, find the Layout / Window State property and change if from Normal to Maximize.
Rebuild your project and your children will now be maximized.
_____________________________________________
The world is a dangerous place. Not because of those that do evil, but because of those who look on and do nothing.
|
|
|
|
|
In my program, I used a DataGrid to display the data from the database. I realized that the column headings are in alphabetical order from left to right, which is not what I want. How can I change the setting to display the columns in my own way? I've tried using the TableMappings property of DataAdapter, but I couldn't make it work. Please give me some instructions about it. Thank you!
|
|
|
|
|
You can use the DataGrid TableStyles.
First you add one GridColumnStyle and a collection of columns to it. Each column you set the 'mapping' value to match the column in ur dataset that u want to display .
No time to breathe
|
|
|
|
|
I got it! Thank you very much!
|
|
|
|
|
I am teaching my self C# and the book I have doesn't show how to scroll to the next record. The standard thing I do is to move to the next/prev record check for eof/bof and if that is true, move to first/last then display the record. I can't find how to move to the next/last/prev/first record. I can think of a way using a global variable and tracking the recordcount and check the location, but the way I mention is easier. Can anyone point me to the MSDN page, or other page that gives a nice example of this? Thanks
|
|
|
|
|
Are you working with either a DataReader object or a DataSet object? If not, then check out these objects before you go any further.
Mark Sanders
sanderssolutions.com
|
|
|
|
|
I'm working with a dataset object.
|
|
|
|
|
Because a dataset is a fully disconnected container for data, datasets (unlike ADO recordsets) do not need or support the concept of a current record. Instead, all records in the dataset are available.
A dataset can be made up of multiple DataTable objects which in turn can have DataRow objects and DataColumn objects. You can use a variety of different means to access these objects such as foreach loops or direct minipulation.
You might checkout http://samples.gotdotnet.com/quickstart/howto/doc/adoplus/getdatafromdb.aspx[^]
Mark Sanders
sanderssolutions.com
|
|
|
|
|
So if there is no methods to a the standard first/prev/next/last, would I need to write my own routines to do such things? Or is there another datatype that I can use have access to this?
This makes scrolling though database records one at a time quite a bit more difficult then I think it should be with a new language.
Or perhaps someone has made such routines I can thiev and use.
Thanks
|
|
|
|
|
There are two ways: you can use notation
this.dataSet1.Tables[0].Rows[i] to point the row you are looking for, or you can play with CurrencyManager. CurrencyManager is much more powerful, and probably this is the routine you need.
link to CurrencyManager Class specs (MSDN):
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwindowsformscurrencymanagerclasstopic.asp
|
|
|
|
|
Hi,
I have very strange problem!
I am deriving my own class, inherited from TabControl.
I need to make my own painting, so I wrote that:
SetStyle(ControlStyles.AllPaintingInWmPaint, true);
SetStyle(ControlStyles.UserPaint, true);
SetStyle(ControlStyles.DoubleBuffer, true);
Then proccessing the OnPaint method worked just fine, but when I decided to handle the scrolling of the tab pages I found out that I CAN'T get rid of the two scroll buttons windows draws on the tab control. I overrode almost every possible virtual method and put "Invalidate" in it, but the scroll buttons still appear
Any idea of how scrolling the pages on my own, without the help of windows?
GAtanasov
|
|
|
|
|
protected override CreateParams CreateParams
{
get
{
System.Windows.Forms.CreateParams param = base.CreateParams;
if (((int)WindowStyles.VSCROLL & param.Style) != 0)
{
param.Style -= (int)WindowStyles.VSCROLL;
}
if (((int)WindowStyles.HSCROLL & param.Style) != 0)
{
param.Style -= (int)WindowStyles.HSCROLL;
}
return param;
}
} This I used for the RichTextBox, should work for a tabcontrol as well.
I rated this article 2 by mistake. It deserves more. I wanted to get to the second page... - vjedlicka 3:33 25 Nov '02
|
|
|
|
|
Well, again
|
|
|
|