|
G.Ringbom wrote:
What do you think, would I get a performance gain by using DirectX compared to using regular GDI+?
Yes, but developing the UI will be much harder. DirectX is really targeted at easing game development, not easing UI development.
For a DB modelling tool, I can't see why you would need high frame rates. GDI+ is more than capable of drawing complex screens at decent speed for an editor.
As an example, I created recently a graphical editor for a rule engine, all done in C# (with a few P/Invoke calls) and the speed is very good on an old test machine (AMD 650MHz - 256MB RAM - PCI Riva TNT2 card) that we have here. Even on the biggest files, it's very usable.
Yes, even I am blogging now!
|
|
|
|
|
Daniel is right. Even programs like Visio use GDI
This posting is provided "AS IS" with no warranties, and confers no rights.
Alex Korchemniy
|
|
|
|
|
As an alternative, you *could* use Avalon instead. It's (should be) easy to use and has power of DirectX (it's based on it). This has, however, several drawbacks:
1. Development difficulties (You must own Whidbey and Avalon/WinFX CTP disc).
2. Release difficulties (you can't release your application until Avalon/WinFX is officially released (for Longhorn and XP).
3. High-spec client-machine needed as Avalon tends to need quite a machine (1 GHz processor, 256 MB Ram, DirectX 9 supporting video card and so on) though you can setup Avalon to work on a low-end machine, too.
|
|
|
|
|
try
{
some code
}
catch(Exception ex)
{
some code
}
How can I loop with "forEach" statement through all exceptions ?
|
|
|
|
|
???
a catch block only catches one Exception. Why do u whant to loop and where?
I don't understand your request
spif2001
|
|
|
|
|
Hi,
Here is one example for SQLError
try
{
some code
}
catch(SqlException ex)
{
foreach(SqlError sqlError in ex.Errors)
{
some code
}
}
Sometimes you get more than one exeption at the same time ( especially SQL for example )
|
|
|
|
|
hi,
As was already mentioned, catch "catches" only one Exception. I think you are trying to do something like :
<br />
try<br />
{<br />
if(stg)<br />
{<br />
myBadFunctionThrowsMySpecificExcpetion();<br />
}<br />
else<br />
{<br />
i= i/0;
}<br />
}<br />
catch(MySpecificException ex)<br />
{<br />
}<br />
catch(Exception ex)<br />
{<br />
}<br />
When exception is raised in try block, it is catched in "closest" catch if throwed exception is (in meaning that operator is would return true - same type or derived class) the same as declared in catch block. If exception of diferent type is thrown, then it passes thru first catch block to another (if present),.. etc. You must write catch blocks from specific to most generic; if you wrote catch for System.Excpetion first, all exceptions would be handled in this block. No other would have chance to trap error.
I only hope this is answer to your question
best regards,
David 'DNH' Nohejl
Never forget: "Stay kul and happy" (I.A.)
|
|
|
|
|
You are close to the problem, but i want get all error messages from all risen errors there. In the last message I have wrote an example for SQL tasks. Here it works, because you can assign a specific error, so I think it shpuld be possible to loop within all possible errors ( I need the name for the element and elements-> foreach(element in elements))
|
|
|
|
|
how about:
try
{
}
catch(Exception e)
{
Exception ex = e;
while(ex != null)
{
Console.WriteLine(ex)
ex = ex.InnerException;
}
}
|
|
|
|
|
Hi,
A question:
How can I create a popup with a textbox or a combobox in it?
e.g. in MS Access 2003 there is such a thing if you do
a right click on a table column to add a filter...
Thanks in advance!
Hornox
|
|
|
|
|
Don't know if the following will work, but maybe you'll give it a try.
Create a simple Form, which contains the TextBox, ComboBox or whatever you want.
Catch the MouseDown or MouseUp event of the controls ,which should open the popup form after a right-click on them, and determine whether the right button was clicked.
If so create an instance of your form, assign the mouse coordinates to the Location property of your form and show it.
www.troschuetz.de
|
|
|
|
|
Hi All,
How to spawn a UI Thread in C#.
I want to show window having ProgressBar while starting application(from main window constructor),application takes some time to start.
The window having progressbar should run in different thread having it's own message que and all.
Thanks
TusharM.
|
|
|
|
|
Maybe try it the other way around. You have a "splash" type screen which is your main constructor. It can load fast as it is small. It fires off a thread that starts the loading of the main app which uses delegates or some such to report back on the loading progress.
Here is an article that may help you out; A Pretty Good Splash Screen in C#
regards,
Paul Watson
South Africa
The Code Project
|
|
|
|
|
You can use Application.Run more then once in an Application.
Try creating new splash form, pass it to Appication.Run method
then run your main form (Application.Run(new MainForm());)
When you need to close the splash screen just close the splashForm
(splashForm.BeginInvoke(new MethodInvoker(splashForm.Close));)
|
|
|
|
|
Hi
I have created a dll in vc++ 6.0 from where i want to send a specific message to my c# application and than want to handle that event in my c# front end
further i am also using that dll in a web seb service in c# that is used in an interface developed in vb.net.
is it possible to send my custom message from vc++6.0 dl to c# web service.
Waiting for ur responce
Thanks.
|
|
|
|
|
I have made a Custom Control and I'm having troubles in design time - I have omitted the Dispose method to the ABox in the code below.
Using the following code in design time (adding an ABox to a Form), i can change the MyComp.MyText property in the property editor and the Text property on my ABox will change.
But I can't change the MyComp.MyList property and make it change the ABox' Items values. It works in RunTime but not in design time.
How come?
Any and all ideas would be very welcome.
spif2001
using System;
using System.Collections;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Windows.Forms;
namespace AgroTest
{
public class ABox : System.Windows.Forms.ComboBox
{
private System.ComponentModel.Container components = null;
private MyComp myComponent;
public ABox()
{
InitializeComponent();
this.myComponent = new MyComp(this);
}
[Category("AgroTest"), System.ComponentModel.DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
public MyComp MyComponent
{
get
{
return this.myComponent;
}
}
private void InitializeComponent()
{
components = new System.ComponentModel.Container();
}
}
}
using System;
using System.ComponentModel;
using System.Windows.Forms;
using System.Collections.Specialized;
namespace AgroTest
{
[TypeConverterAttribute(typeof(ExpandableObjectConverter))]
public class MyComp
{
private ABox owner;
private StringCollection myList = new StringCollection();
private string myText = "!!";
internal MyComp(ABox owner)
{
this.owner = owner;
}
[Editor("System.Windows.Forms.Design.StringCollectionEditor, System.Design",
typeof(System.Drawing.Design.UITypeEditor)),
DesignerSerializationVisibility(DesignerSerializationVisibility.Content),
DefaultValue(false)]
public StringCollection MyList
{
get{return this.myList;}
set
{
try
{
this.owner.Items.Clear();
foreach(string s in value)
{
this.owner.Items.Add(s + "!!");
}
this.owner.Invalidate();
this.myList = value;
}
catch(Exception){}
}
}
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content),
DefaultValue(false)]
public string MyText
{
get{return this.myText;}
set
{
try
{
this.owner.Text = value;
this.owner.Invalidate();
this.myText = value;
}
catch(Exception){}
}
}
}
}
|
|
|
|
|
Hi,
Try calling the InValidate() method, even after you set the value in the property.ie,
In "public StringCollection MyList" and "public string MyText", in the set block , call Invalidate after u set the value to MyText.
Try this and let me know...
Regards,
Manivannan
|
|
|
|
|
Sadly it had no effect - thanks though
|
|
|
|
|
Hi i'm new to C# and i'm trying to create a telephone Call Record on a datagrid but i couldn't get anything displayed on my datagrid. Though i assigned my datasource to be my call records. I was just wondering if anybody can give me a little lecture on datagrids.
Thanks.
|
|
|
|
|
Could you post some code as to how you are assigning the datasource? Is this a windows form app or a web app?
|
|
|
|
|
I want to get and set ShortDate format from control pannel setting.how can i do in C#.
Pls answer me.
|
|
|
|
|
I can only point you in the vague direction of the Globalisation namespace of .NET. This article mentions changing the CulterInfo (which is what you want) of a thread.
regards,
Paul Watson
South Africa
The Code Project
|
|
|
|
|
hi,
i need to create new tabpage in runtime by user action. and, each tabpage should be the same with same controls. i draft a Panel User Control. i planned to use it to insert in the tabpage dynamically.
anyone have idea on this issue?
thanks,
jim
|
|
|
|
|
Try this:
1. drag and drop a textbox ctrl, a button and a Datetime picker.
2. run the application and press tab . u can see the focus in each control including DTpicker.
3. Just select another date in the dattime picker using that combo.
4. now press tab , u will see that DTPicker doesnt receive the focus....
help me if u can brin the focus ....
regards, Mani
|
|
|
|
|
hello i am creating a docking window class and so far it all works and im just using the regular dock property and it inherits from Form when my form is docked to the parent and is resizable i can resize it however when it loses focus it snaps back to fill the parent i tried saving the size in the resize event and setting them in both paint and deactivate events however neither will retain the size what can i do to make it save the size when it gets resized.. i am using similar code when it is not docked and that works fine
|
|
|
|