|
My application will be running on a slow PIII-400 machine. And the application needs to display a lot of pictures.
At a point i need to bring up a dialog, covering the pictures. When the dialog hides, the covered form cannot refresh fast enough so that it looks very choppy.
This program is gonna be used in a restaruant, it cannot give impression that the program suk, is that any way to make sure the background has been drawn, before the foreground(the dialog) hides?
|
|
|
|
|
Not really. For such a slow machine, you're probably going to have to back-off on the use of background images. This is especially true if you're using images larger than they need to be and scaling them down to fit inside the form and using a lower end video card.
Keep in mind that your app is going to have to have it's own minimum system requirements. You can't just put something together and get good performance on one machine and expect that same performance on lower end hardware.
There's a bunch of optimzation techniques, but what to do is very dependant on your code and form design.
Scale images down to the size you need for the form. For example, don't use a 1280x1024 image on a form that's only 320x200. You'll waste too much time loading all the extra data you're never going to see. Along the same line, if you can get away with a 256 color image, instead of 24+ bit images, do it! The less you have to load, the better.
Don't use an exessive number of controls on a form. Controls are very expensive to create and place dynamically. Also, calling all the Paint methods for those controls takes a while too. The less you have to paint, the better!
... There's lots of things you can do, but what you do depends heavily on your code, and more importantly, your design.
You can start by skimming through Improving .NET Application Performance and Scalability[^].
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi all! I am getting an invalid cast error in the constructor of a form. There is no code in the constructor except for the InitializeComponent(); In the debugger, it goes through each line of the IntializeComponent method, returns, then pops out the error? What am I looking for here?
Thanx!
Jude
Jude
|
|
|
|
|
Is it on the return of the constructor?
--------
"I say no to drugs, but they don't listen."
- Marilyn Manson
|
|
|
|
|
It is after the return of InitializeComponent()..the form builder if you will. After goes through th last line, returns then invalid cast error.
Thanx for the quick reply!
Jude
|
|
|
|
|
Is it ON the return from InitializeComponent() or after (like when the constructor is exiting). Do you have a destructor (or similar) performing some type casting?
--------
"I say no to drugs, but they don't listen."
- Marilyn Manson
|
|
|
|
|
It is inbetween the return from the contructor and empty space..the debugger goes to the //TODO...comments first line and the very next step I get an invalid cast operation. I think I may just wipe it and start a new form.
Thanx for the help though!
Jude
|
|
|
|
|
TheJudeDude wrote: the debugger goes to the //TODO...comments first line
This is not possible. Something tells me that your source code is not in sync with the compiled code.
--------
"I say no to drugs, but they don't listen."
- Marilyn Manson
|
|
|
|
|
I don't know...it happened, but I rebuilt th form, and now all is well. I appreciate the replys though.
Thank you
jude
|
|
|
|
|
hi guys,
i need to know if a process that im monitoring has exited.. im using c#, and a noob in using the Process class. for example, im monitoring MS word, i can tell if it starts but i can't catch the event, the moment it terminates... help pls..
|
|
|
|
|
Is there a way to find out the what the 'master volume' (the one on the Volume Control app) level is set to?
Thanks
|
|
|
|
|
Just found this
http://www.codeproject.com/useritems/AudioLib.asp
|
|
|
|
|
hi. i made a simple web browser. i want if i push 'Enter' button url must load.
in microsoft example i see^
void Form1_KeyPress(object sender, KeyPressEventArgs e)
{
// Navigate if the ENTER key is pressed
if (e.KeyChar == '\r')
Navigate();
}
i re-made this for my project^
void webBrowser1_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == '\r')
this.webBrowser1.Navigate(toolStripTextBox1.Text);
but in 1st & second ezmples didnt work. please tell litle beginner how made this.
thanks for your help
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
Athlon 64 3500+, Gigabyte GA-K8NXP-9, 2x512 DDR400 Kingston, Inno3d 6200 PCIe, SS2 B2C2 v2.6, HDD := 450gb, Genius 56k int, NEC DVD-RW и мать его Суньмастер 550.
|
|
|
|
|
if you want to capture the ENTER key, then thes if e.KeyCode == Keys.Enter
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
ok thanks i did it, but not work i compile without erors but nothink hepend when i push 'Enter' key. please look my code^
private void Form1_KeyPress(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
this.webBrowser1.Navigate(this.toolStripTextBox1.Text);
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
Athlon 64 3500+, Gigabyte GA-K8NXP-9, 2x512 DDR400 Kingston, Inno3d 6200 PCIe, SS2 B2C2 v2.6, HDD := 450gb, Genius 56k int, NEC DVD-RW и мать его Суньмастер 550.
|
|
|
|
|
The if clause should work. Check in the debugger, if Form1_KeyPress is called, maybe you forgot to subscribe to the form.KeyPress event handler?
this.KeyPress += new KeyPressEventHandler(Form1_KeyPress);
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Hi
I want to know how can i use the visual studio Query Builder I think it is in Microsift.VSDesigner assembly but I dont know how to use it.
Thank you for your help
|
|
|
|
|
Hi all,
I'm declaring a property...
<br />
public int Number ()<br />
{<br />
get <br />
{ <br />
return myInt; <br />
}<br />
set <br />
{ <br />
myInt = value;<br />
}<br />
}<br />
and I'm getting a build error. The complaint is coming from the get and set keywords, it is asking for a semi-colon (;) to be placed after each. I also believe that value should be a keyword (i.e. highlighted by the ide) which it is not.
Can anyone help because I thought this was pretty straightforward.
|
|
|
|
|
richiemac wrote: public int Number ()
Properties are declared without the brackets. The compiler thinks you're trying to declare a function.
Should be:
public int Number {
get {return MyInt;}
set {myInt = value;}
}
Share and enjoy.
Sean
|
|
|
|
|
public int Number
{
get
{
return myInt;
}
set
{
myInt = value;
}
}
try this.
|
|
|
|
|
Properties don't need brackets ( and ) in the method header
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Thanks guys!
Knew it was something trivial.
|
|
|
|
|
I guess I'm missing something. I've designed a testbed app to help me learn C# (I come from a Delphi background) and I've got the menu set up. Plus I've added in the AboutBox form to my project. Now how do I open the AboutBox when I click on the Help|About... menu choice - what code do I stick in there to open AboutBox1? And then, once I've got the AboutBox open, what code do I put in at the Close button's Click event to make it go away?
In Delphi I'd just put in (on the main form's Help|About... Click procedure) the code:
AboutBox.Show;
Also in Delphi, I'd put in the AboutBox's Close button Click procedure the code:
Self.Close;
Can anyone give me a clue, maybe drop me a sample project at:
delphidb-AT-comcast-DOT-net
Derek Benner
|
|
|
|
|
In the Visual Studio dialog designer you can doubleclick on the menuitem, it will then generate the click code for you. You can then open the form like this:
AboutBox about = new AboutBox();<br />
about.ShowDialog();
Closing the form is easy as can be: Close();
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Okay. Tried that. Got it to work. Thanx!
One thing.
C# is *very* picky about them trailing Open and Close parens isn't it? '()'.
Derek
|
|
|
|