|
Mehmet Fatih Akbulut wrote: what if i want to use that 'text' in another function or class ?
Then you see to it that the value gets there. There is nothing magical going on, the values are where you put them.
Mehmet Fatih Akbulut wrote: and what if i have to pass not just one value but many values between forms ???
Then you use more than one parameter or put the values together in a class or struct and pass that along.
Mehmet Fatih Akbulut wrote: secondly: i defined that textbox1 (on form1) as public and in form2 defined something like this :
Form1 x = new Form1();
lblUserName.Text = x.textBox1.Text; > gives nothing ;(
lblUserName.Text is an empty string ??? cant i get the string value of textbox1 from form1 to form2 by setting it to public ???
where am i doing wrong ???
You are creating a completely new instance of Form1. That instance will not have the data that you put in the instance of Form1 that already exists. To access the data in the existing instance, you need a reference to it.
---
b { font-weight: normal; }
|
|
|
|
|
|
Mehmet Fatih Akbulut wrote: > To access the data in the existing instance, you need a reference to it.
how can i do this ?
would you please explain a bit more ?
or give a simple example ¿
You can send the reference along when you create the form:
Form2 mehmet = new Form2(this);
And recieve it in the constructor:
public Form2(Form1 form1)
---
b { font-weight: normal; }
|
|
|
|
|
You can use your own custom event and Delegates to achieve the same
|
|
|
|
|
Hi
Consider a RichTextBox with same data in it. Now when a user presses Ctrl key and Scrolls using the mouse the data present in the RichTextBox Zooms In/Out.
I want to disable the zooming of text in RichTextBox. I tried the following code and it worked on my machine but didnt work on other developers machine (not sure why).
private void RichTextBox_MouseWheel(object sender, MouseEventArgs e)
{
base.ZoomFactor = 1.0f;
}
How can i disable Text Zoom In/Out? Is there a property in RichTextBox which i am missing? Please let me know.
Thanks in advance
Kaushik
Development Environment
.Net Framework 1.1
Windows Forms
Microsoft Windows XP Professional Version 2002, SP2
|
|
|
|
|
I have my control inheriting from UserControl
I need to handle the KeyDown & KeyUp of the Control Key (CTRL) but the no use the OnKeyDown & OnKeyUp events are never called only I can handle the ProcessDialogKey
But this doesn't satisfy my need as I want to handle the ControlKey Press + MouseClick
Is there a way out to handle to assure that the ControlKey is being clicked
Thanx in Advance
compubaby
|
|
|
|
|
Maybe the KeyPreview Property is false?
|
|
|
|
|
No it's not
I need to catch the WM_KeyUp & I tried
PreProcessMessage
OnKeyUp
ProcessKeyMessage
ProcessCmdKey
even the WndProc
and many other but no use the WM_KEYUP isn't recieved
compubaby
|
|
|
|
|
I solved it
I found the ProcessKeyPreview is the only one that worked with me in recieving the WM_KEYUP
Thanks to all
compubaby
|
|
|
|
|
Hi,
I have one string like ParentInvids which contains ids
i.e string ParentInvids=1,2,3;
How can i display those values like ParentInventoryIds are 1,2,3
Is it possible to use stringbuilder
can anybody send tell
|
|
|
|
|
Hello, i am trying to write an application that saves about 11,520 images a minute a windows disk. The image size varies round the 8 to 20 kb. The application needs to run 24 / 7. At the moment i have a windows XP server service pack 2 and if i run the application after a 5 / 10 min the server crashes as the memory goes up and up. The commit charge rises all the time. I dont think i have a memory leak in the program but maybe the application is stressing the OS. Any raccomandations? any tuning i can do to the system. The application is written in c# .net v 2.0
Any help would be great as i have been banging my head on a wall now for some time
Thank in advance to any one that will take the time to read this
|
|
|
|
|
11520 a minute equates to 192 a second, sounds like alot of disk IO but maybe im wrong!
Are you sure you are disposing of objects correctly? Anything which implements IDisposable should have the Dispose() method called when you are done using it. If I remember correctly Image is IDisposable - could this be it?
Current blacklist
svmilky - Extremely rude | FeRtoll - Rude personal emails | ironstrike1 - Rude & Obnoxious behaviour
|
|
|
|
|
Hello and thank you for your replay, I am callind Dispose() on any object that implements IDisposable!
I am really stuck, not sore what it could be
|
|
|
|
|
It could be that writing 192 images a second is too much for windows to handle, have you tried it on a smaller scale?
Current blacklist
svmilky - Extremely rude | FeRtoll - Rude personal emails | ironstrike1 - Rude & Obnoxious behaviour
|
|
|
|
|
If memory keeps going up and up, the system may be too busy to allow the garbage collector to continue collecting. You can force a garbage collection using GC.Collect() and GC.WaitForPendingFinalizers().
Also, after you dispose an image, make sure you call GC.SuppressFinalize(theImage) so that the GC knows the finalizer doesn't need to be called on the image.
Since you're doing so many images per second, every little bit counts. If you're still having trouble, try running your app under a memory profiler such as ANTS[^].
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Islamic Domination: Coming to a Jewish state near you!
The apostle Paul, modernly speaking: Epistles of Paul
Judah Himango
|
|
|
|
|
thanks i will try this tonight and let you know
thanks again
|
|
|
|
|
Hi
Has someone any experience with such an upgrade?
I am going to do that with my C# windows based application.
Is it safe to install VS2005 with VS2003 already installed?
Is it fully compatibile?
I mean can I have installed simultanously both versions?
Any advice or warning?
Thanks
Ela
|
|
|
|
|
e_LA wrote: Has someone any experience with such an upgrade?
I am going to do that with my C# windows based application.
At home I've only tried opening very simple VS 2003 apps. in VS 2005. There were no problems. Might be a different with an industrial-strength app. that you might have at work. Where I work at the moment, a colleague will shortly be attempting to open one a VS 2003 web app. in VS 2005 and seeing whether everything workss.
e_LA wrote: Is it safe to install VS2005 with VS2003 already installed?
Is it fully compatibile?
I mean can I have installed simultanously both versions?
Yes to all. You shouldn't have any problems. VS 2005 will install side by side with VS 2003. Only issue might psossibly be the database, if you're also installing SQL Server 2005 alongside SQL Server 2000. For myself, I never had SQL Server 2000, but I did have MSDE 2000 and ran into some issues. But the upshot is that I still have MSDE 2000 installed as well as SQL Server 2005.
Kevin
|
|
|
|
|
Thanks for the answer. If you know more from you colleague please let me know.
Ela
|
|
|
|
|
You will certainly get quite a few warnings when you open VS 2003 projects. Some of these will be for obsolete method calls (the app. will still run, but they just suggest that you use a newer API). You'll also get warnings in HTML files because they're now tracking XHTML 1.0. But again they'll still run.
C++ code will definitely be something different though!
Kevin
|
|
|
|
|
|
Hi Kevin
Thanks for the link. I am upgrading windows application not web one.
However some issue will be usefull I supppose.
I have upgraded my aplication and everything was fine except code written in C++. There was a change in C++ compilator in VS2005 and I am struggling with that now
Ela
|
|
|
|
|
OK, yes you'll have fewer problems with windows forms than ASP.NET.
e_LA wrote: There was a change in C++ compilator in VS2005 and I am struggling with that now
Yes, I warned you that you might have problems with C++!
Try googling on "Breaking changes in Visual C++" or something like that. A lot of the problems are to do with MS making the compiler more conformant with the C++ standard.
Kevin
|
|
|
|
|
Kevin
I have been founding in google etc. and I did not found anything usefull.
However I am still looking for that.
I consider to translate the C++ code to C#. I was going to do that in the future but maybe I will have to do it now.
Ela
|
|
|
|
|
Yes, you can safely have them installed side by side.
š
Cheers,
Vikram.
I don't know and you don't either.
Militant Agnostic
|
|
|
|