|
|
Nick's solution works for Managed DirectX 9. How you do it in your 3D engine is implementation-specific. I recommend you use Managed DirectX 9 for your application. Yes, this requires DirectX but it has much better support and the Managed library is a ground-up development, not just a simple wrapper around the typelibs for DX.
A good book to learn about MDX9 is Managed DirectX 9 Kick Start : Graphics and Game Programming[^].
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles]
|
|
|
|
|
I did build the engine from managed directX. This is because it was the easiest way to build it. Thanks for the tip of the book.
I got the effects to work now
"Every rule in a world of bits and bytes can be bend or eventually be broken"
|
|
|
|
|
Hello,
First of all ,thank you for your concern.
My program which im going to show to my superiors, consists of a main form which acts as an image viewer,where i can open an image in one picture box and zoom into the image.The zoomed image appears in a second picture box.Now, in the menu there is a "rotate " menu item which opens a child form which asks for the degree of required rotation.
In my program, when the child form opens , it stays in the background of the main form.Any controls (picture boxes etc.)of the main form always stay in the foreground.
how can i solve this problem
Thank you
thank you
|
|
|
|
|
You mean when you call Form.Show or Form.ShowDialog (don't forget to call Dispose in the latter case when done with the Form ), it goes to the background? If that's the case, more explanation about what your application is doing at the time is necessary.
If you want the child form to always be in the foreground even when the main form is clicked, once you instantiate the child Form set it's Owner to the main Form , or call AddOwnedForm on the main Form passing the child Form as the parameter. Use Form.Show instead of Form.ShowDialog (creates a modal dialog in the latter case). This will create a modeless Form that is owned and subsequently closed by the main form.
See the .NET Framework SDK documentation for the Form.Owner property and Form.AddOwnedForm method for more information.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles]
|
|
|
|
|
You're not supposed to have controls or anything else like that in an MDI main window. You have to put everything into plain child windows or MDI child windows.
|
|
|
|
|
Hi,
I'm pretty sure this is as easy as it gets, but I couldn't find anything in the documentation.
I'd like to change the string representation of an int so, that the numbers get padded with 0's up to a certain amount of characters: For example I'd like to pad up to 4 characters, then a 17 should look like this '0017'.
Any help is greatly appreceated.
Matthias
If eell I ,nust draw to your atenttion to het fakt that I can splel perfrectly well - i;ts my typeying that sukcs.
(Lounge/David Wulff)
www.emvoid.de
|
|
|
|
|
If you take a look at Numeric Format Strings[^] in the .NET Framework SDK documentation, you'll see the following will work:
using System;
class Test
{
static void Main(string[] args)
{
int i = 17;
Console.WriteLine(i.ToString("0000"));
Console.WriteLine("{0:0000}", i);
}
}
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles]
|
|
|
|
|
Try looking up Format Specifications. What you want is something like "%04d"
|
|
|
|
|
This is C# Mark, not C/C++.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles]
|
|
|
|
|
Right, my mistake. Damn all these languages.
|
|
|
|
|
I have a collection object that contains hierarchical data... Here's how it looks:
ID, Name, ParentID, Description
=================================
1 , Bob, NULL, I'm a parent
2 , Sam, 3, I'm a child
3 , Tom, NULL, I'm a parent
4 , Jill, 1, I'm a child
5 , Kid, 2, I'm a grandchild
I need to get these items into a tree stucture... Notice that the list is unordered. My coder sensors sense a recursive routine, but I'm wondering if there is some other solution hanging out there I haven't thought of.
Thanks,
Adam
|
|
|
|
|
I've developed a system like this that is actually quite fast, and have posted the solution here before. One thing to add, though, use TreeView.BeginUpdate and TreeView.EndUpdate before and after you build the tree, respectively.
See http://www.codeproject.com/script/comments/forums.asp?msg=911562&forumid=1649#xx911562xx[^] for details (which includes a link to another thread where I've discussed this before).
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles]
|
|
|
|
|
Adam Wimsatt wrote:
My coder sensors sense a recursive routine, but I'm wondering if there is some other solution hanging out there I haven't thought of.
I don't see this as recursive. Rather, I would walk the list in two passes.
Pass 1: Create nodes
Pass 2: wire-up child/parent relationships
I'd probably maintain a Hashtable keyed with the ID to easily locate the parent node.
Once the tree structure is built, you can put it into a view, like a TreeList. This kind of stuff is perfect for an MVC pattern--the Controller can manage getting the data out of the database, the Model can manage the internal tree management, and the View can handle constructing a TreeList or other visual representation.
Well, that's my 2c.
Marc
MyXaml
Advanced Unit Testing
|
|
|
|
|
Hi
I'm using a WebBrowser object in my form to display the results of a Dataset. All is good in formatting the html into a table, but I'm seeming stuck with the standard stylesheet - Times Font and all the other defaults.
How can a set a stylesheet when I set the HTML data? Saving the report to a temporary file and navigating to it causes the control to use the stylesheet defined in the file, but I don't want to do it that way, I want to set the text and set the stylesheet all with my program.
Cheers
Dave
|
|
|
|
|
|
As far as I can tell that returns a read-only collection of stylesheet - if the page had a stylesheet to begin with I could possibly alter it, but not add to them
I did manage a sort-of work around using the createStyleSheet method of msthml.HTMLDocumentClass. It does mean having to have the stylesheet in a file rather than generate it, but it does what I need it to.
|
|
|
|
|
Just to let you know, Microsoft.mshtml.dll comes with VS.NET, IIRC, which is far better to use than creating your own since it's the PIA (primary interop assembly) produced by Microsoft. I think it also comes with Office, but I'm honestly not sure.
Just letting you know.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles]
|
|
|
|
|
Thanks, I will keep that in mind the next time a similar question is asked here.
- Nick Parker My Blog | My Articles
|
|
|
|
|
Hi all!
Here is my problem:
I am developing a Windows service written in C#. The work of this service is to send an alert by mail when the total memory of the OS is too high for example. I'm using the System.Web.Mail namespace to send a mail and everything is ok. I put this piece of code in a thread to make my application more reliable, like that:
' the code for sending mail is in the ThreadLoop method of the Job class
Thread jobThread = new Thread(new ThreadStart(current_job.ThreadLoop));
jobThread.Start();
' wait until the job is done or the timeout is reached
bool noTimeout = current_job.Mre.WaitOne(30*1000, false);
' stop the thread...
jobThread.Abort();
Ok. My problem occured when there is a big file attached to the mail, and the timeout is reached. The method Abort() does not quit the thread until the entire mail is sent...
And I cannot add a timeout to the System.Web.Mail.SmtpMail.Send method, then I am stuck.
Is there a way to force the termination of a thread?
Thanks.
|
|
|
|
|
I need a component that I can drag around the form at run time. The component must have multiple text sections. And the user should be allowed to drag and drop buttons anywhere on the component. The component should be able to be stored, in other words if the program is closed and re-opened the component should be rebuilt with the same text and buttons in the same place
Basically this is what I need:
Text text text text text text text text text text text text text text
text text text text text text text text text text text text
text text text text text text
text text text text text text text text text
text text text text text text
text text text text text text text text text text text text
<<Button1>>
text text text text text text text text text text text text
text text text text text text
text text text text text text text text text
<<Button1>>
|
|
|
|
|
You should try searching for one, then. The C# forum is for specific problems with the C# language and related .NET question (ASP.NET question - even if written in C# - belong in the ASP.NET forum specifically).
This web site includes many articles about document/view, runtime drag and drop, and serialization. MSDN[^] (the Microsoft Developer Network) has many other articles, and you can always google[^].
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles]
|
|
|
|
|
Hi all,
When i change an expandable property of an object from the property grid, the set method of that propertin is not being called, where as the set methods of its sub properties are being executed.
what may be the reason?
please help...
regards,
Pradeep
|
|
|
|
|
If this is a property you're developing, you should implement your own TypeConverter [^] (for an expandable object, extend ExpandableObjectConverter [^] if you like). You'll want to override and implenent the GetCreateInstanceSupported and CreateInstance methods. You should read the documentation for these in the .NET Framework SDK, which includes examples.
This will create a new object to be serialized to your source code file, which the designer will handle automatically.
Another good section of the .NET Framework SDK to read is Enhancing Design-Time Support[^], which covers a lot of design-time topics.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles]
|
|
|
|
|
Thanks stewert.. It works fine.
|
|
|
|