|
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
|
|
|
|
|
Thanks ,leppie
Your code should work for ONE CONTROL, but the case here is not that:
I finally found out what is wrong with MyTab
As it wrappers the common controls TabControl when scrolling of the tab pages is needed
a new updown control is created that has nothing to do with the parent TabControl and thus it receives no messages through its parent
Now my question is do you have any idea of how to get to that updown control and prevent it from displaying?
Cheers,
Gogou
GAtanasov
|
|
|
|
|
You shouldn't really use addition or subtraction for bitwise operations. You can just use:
param.Style &= ~(int)(WindowStyles.VSCROLL | WindowStyles.HSCROLL);
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
|
|
|
|
|
Hi!
I would like to know how to convert System.DateTime to System.Runtime.InteropServices.FILETIME?
Thanks!
|
|
|
|
|
long ftime = DateTime.Now.ToFileTime();
FILETIME ft = new FILETIME();
IntPtr pftime = Marshal.AllocHGlobal(Marshal.SizeOf(ftime));
Marshal.Write(ftime);
ft.dwHighDateTime = Marshal.ReadInt32(pftime);
ft.dwLowDateTime = Marshal.ReadInt32(pftime, Marshal.SizeOf(int));
Marshal.FreeHGlobal(pftime);
I rated this article 2 by mistake. It deserves more. I wanted to get to the second page... - vjedlicka 3:33 25 Nov '02
|
|
|
|
|
static FILETIME FileTimeFromDateTime(DateTime date)
{
long ftime = date.ToFileTime();
FILETIME ft = new FILETIME();
ft.dwHighDateTime = (int)(ftime >> 32);
ft.dwLowDateTime = (int)ftime;
return ft;
}
static DateTime DateTimeFromFileTime(FILETIME ft)
{
return DateTime.FromFileTime(
((long)ft.dwHighDateTime << 32)
+ (long)ft.dwLowDateTime);
}
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
|
|
|
|
|
I'm trying to show XML that I get streamed to my app in a browser control. To test, I've dropped a control on a form and let the designer do the init work (BeginInit, misc. code, EndInit). Here's what I've added in my form's ctor :
<br />
object a = string.Empty;<br />
axWebBrowser1.Navigate( "about:blank", ref a, ref a, ref a, ref a );<br />
<br />
string xml = "<ROOT><test_node>42</test_node></ROOT>";<br />
((IHTMLDocument2)axWebBrowser1.Document).body.innerHTML = xml;<br />
The last line throws a NullReferenceException. I'm not sure why -- this code is supposed to work, right? Can someone pass on some advice on how to make this work or on the proper way to show XML in a browser control?
Thanks!
|
|
|
|