|
In WinForms programming I made 3 Forms.
and the 3 forms have same menu but the menu load all forms each of menu item.
So I think I want to make it does not take more resource when hide a form and show another form.
So I made write down like this...
class Form1
public Form2 form2; Form3 from3;
Form1()
{
form2=new Form2();
form3=new Form3();
}
and like above in another form.
it makes a recursive function and resource take more and more, it can't show main screen. constructor has all resource, it is not I want.
then I copy some code that is using owner but It has some more and more resource when I open file and close file.
I can't use form1.Close it will shut down my program. then I can't get resource when I hide a form.
menu can bring any another form of my program and then hide or close using form.
I must implement it. but I'm a beginner. So I want kind explain.
thanks you for reading.
Image will remind us some feelings and if I can ask someone about a problem, that's not a bad life.
|
|
|
|
|
hi,
The problem is the way you are programming. i am totally confused
Tell me your real requirement. i can help you out.;)
**************************
S r e e j i t h N a i r
**************************
|
|
|
|
|
Hi
Can you try solving your problem using MDI form. Create a MDI form and make your forms as child's of it.
You can make a form as MDI form by setting its IsMdiContainer property to true.
You can make your forms form1, form2, form3 as child forms by setting their MdiParent property to object of your MDI form.
Guess this solve your problem
If you need more help let me know.
Thanks.
|
|
|
|
|
Hi!
I wanted to know how to add code at the OnClick() event of "Next" on acceptance of License Agreement in C# setup and deployment projects. I cant see the source files. I definitely think it is possible, but how and where, please guide me, i am new at this.
Thanks for any help.
-Samir
|
|
|
|
|
Hi,
In a text change event I am loading a list of suburbs based on the user input. When i clear the combobox items I loose the text as well. When I reset the text it calls the change event again and I get a loop happening. How can I clear the items without loosing the text in the box? OR What is a better way than using the text changed that will not be triggered when i write the text back?
Thanks for any help.
|
|
|
|
|
hi,
Better you need to store the selected value to some temporary string variable.
Like string TempString=Combo1.Text;
Then try to clear the items.;)
**************************
S r e e j i t h N a i r
**************************
|
|
|
|
|
while writting WMI application, i could read many values by means of System.Management namespace.
many examples show how to read the values in Win32_class.
my question is : How to modify the value in Win32_class using System.Management namespace ?
there are some methods which might do this work such as Put(), SetPropertyValue(). But How to use them ?
|
|
|
|
|
I'm using Media Player to play media files, and my problem is getting it to play multiple files where my code does the queuing. I get a medaEnded message, but if I queue another file, it doesn't play. Does anyone have any ideas ?
And anyone who suggests DirectX will be shot. DX9 is an absolute joke, that's why I'm trying to get the core of my app working with Media Player 3 days before I deliver the application.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
Heath Stewart wrote:
CharSet=CharSet.Auto
Gotcha, I'll try an be more complete next time. Thanks.
- Nick Parker My Blog | My Articles
|
|
|
|
|
thx for your answer...but i already have the handle of the window...all i want is to get the urls of the address bar in case of the IE or the opened folder in case of he Explorer ...how can i accomplish this?
thx for your time
|
|
|
|
|
Hello Gurus,
I deployed a windows-based applications with some crystal reports on client machines. Running the reports popped up the following error on client machines.
Error: Cannot find KeycodeV2.dll, or invalid key
Where can I find the "LicenseKey" tag to enter my registered key code?
Thanks gurus, with another $million,
Khang
===================================================================
Crystal Reports Rep. gave me the following instructions but I could not find it at all:
This error may occur if the LicenseKey value is not entered. Kindly follow
the steps given below to enter the value:
* Right click "Project" in the Solution Explorer
* Click "Add" and then "Merge Modules".
After clicking "Merge Modules" it will have a property "LicenseKey" in which you can enter the value.
|
|
|
|
|
When you first started the Crystal Reports tool in Visual Studio .NET, it prompted you to register. This email - per the instructions on the screen when you finished registering - includes your registration information that needs to be entered to use the designer, as well as the Crystal_regwizXXXX.msm merge module if you're building a Windows Installer project.
Read Deploying Crystal Reports in .NET Applications[^] in the Visual Studio product documentation.
If you're using the standalone edition, you need to read the instructions for the steps required to accomplish what I outlined above. I doubt that it's very different, and the merge modules should be the same.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles]
|
|
|
|
|
Hello Heath,
Thank you so much for replying so quickly. Yes, I already registered my Crystal Reports product for MS Visual Studio 2003.
As I understood from the Crystal Reports Rep., after adding the merged module "Crystal_regwiz2003.msm" to the Setup Project, I will have a KeyCode tag to enter my registered key code. However, I could not find this tag any where. And I still get that run-time error.
Thanks,
Khang
|
|
|
|
|
In Visual Studio (or whatever you're using to create your Windows Installer package), select the Crystal_regwiz2003.msm merge module. In Visual Studio, right click and select Properties. This displays the PropertyGrid. In there is a custom property that should be obvious. I don't have this machine set up for that right now, but - like I said - it should be obvious.
Set the property value ot your key code, recompile the package, and redeploy it. This is also covered in the documentation for which I gave you a link.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles]
|
|
|
|
|
I got it. It was hiding under the "MergedModuleProperties" tree. I expanded the tree and saw that property.
You're great, Heath. I guess life is very sweet at Microsoft?
Thanks so much
Khang
|
|
|
|
|
Hi,
I have a file which contains 13726 names on a text file (my school's students' names). Every line contains one name. And I have a textbox on a form which gets the name of the file and when I press the button it has to make seperate files which has 300 names in it. I mean I have to seperate these 13726 names on different files which has must contain 300 names and the last one must have 276 names in it. I made my button's function like below:
<br />
private void button1_Click(object sender, System.EventArgs e)<br />
{<br />
int a=1; int b=1; int k;<br />
StreamReader re = File.OpenText(textBox1.Text.ToString()+".txt");<br />
string input = null;<br />
ArrayList arrText = new ArrayList();<br />
while ((input = re.ReadLine()) != null)<br />
{<br />
arrText.Add(input);<br />
if(a%300 == 0)<br />
{<br />
FileInfo t = new FileInfo(textBox1.Text.ToString()+"_"+ b + ".txt");<br />
StreamWriter Tex = t.CreateText();<br />
for(k=(b-1)*300;k<(300*b)+1;k++)<br />
{<br />
if(k==0)<br />
{<br />
Tex.WriteLine(arrText[k+1]);<br />
}<br />
else<br />
{<br />
Tex.WriteLine(arrText[k]);<br />
}<br />
}<br />
Tex.Write(Tex.NewLine);<br />
Tex.Close();<br />
}<br />
a++;<br />
}<br />
re.Close();<br />
}<br />
but I couldn't get a result so any help would be greatly appreciated...
Thank you,
Cem Louis
|
|
|
|
|
Ok lets start right at the beginning - there were quite a few issues with this block of code.
1.) The reason why nothing gets written to begin with is that your test
'a%300 == 0'
Will only do something every 300 items. The test you want to make is
'a%300 != 0' since for every item BELOW 300 you will always get a
remainder (e.g. 1%300 = 1, 2%300 = 2 etc)
2.) Having got the code to move past this first check we then have a problem with the next for loop because you may not necessarily have 300 items in your array - in fact you'll only have one the first time through.
3.) Also I am curious why you are adding 1 to K for the first every entry
cemlouis wrote:
if(k==0)
{
Tex.WriteLine(arrText[k+1]);
}
Since again the first time through you will only have one item in the array and arrays are ZERO indexed.
4.) I would recommend reading in the entire array and then writing out the contents in 300 blocks and then whatever is left for the last block. I would also suggest writing out the new files as XML since it will be easier to PARSE later and also can be used to show the information with little extra work on your part.
Hope that this helps a little
Markgr
|
|
|
|
|
Hello Gurus,
How can you find out which row and column when the mouse hovers or moves over a DataGrid control? Not Mouse clicking! I'm in C#; I guess it's similar for VB.NET.
Thanks with a $million,
Khang
|
|
|
|
|
Check out the MouseHover and MouseMove events, you will just need to write a handler method for whichever you decide to monitor. You can perform a HitTest[^] to get additional information as well.
- Nick Parker My Blog | My Articles
|
|
|
|
|
Thank you so much, Nick. I will try it out.
Khang
|
|
|
|
|
I am using C# to write a test executive to control different instruments and need to be able to set properties of controls from different classes while not in the form class. any ideas
Greg
|
|
|
|
|
The other classes need to have a copy of your form class, and it needs to expose properties to set the values in question. Or, a nicer way to do it is to set events that, when fired, set the values in question, and subscribe the classes that set the properties to fire those events.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
Christian Graus wrote:
The other classes need to have a copy of your form class
You should use the term copy carefully. Since controls are reference types, another class needs a reference to that control. One could always enumerate the public Control.Controls property as well, meaning that you wouldn't need to have a reference to that specific control at execution time so long as you could identify it.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles]
|
|
|
|
|
Heath I was messing around with enumeration and was wondering if you had some code available. I know VB.NET real well but have just started working with C#.
GregD
|
|
|
|
|
You should start by reading the Visual C# Language[^] reference in the Visual Studio product documentation. Just fumbling around won't give you the building blocks you need. I'm all for self-discovery, but a basic amount of knowledge has to be acquired (like a language), not so much learned. Even just browsing the keywords (like foreach I'll use in a moment) can help immensly.
Enumeration in C# is rather easy:
int[] nums = new int[] {1, 2, 3};
foreach (int num in nums)
Console.WriteLine(num); This is compiled to this similar code:
int[] nums = new int[] {1, 2, 3};
IEnumerator e = nums.GetEnumerator();
int num;
while (e.MoveNext())
{
num = (int)e.Current;
Console.WriteLine(num);
} This code is universal to any managed language, since it uses classes defined by the CLI. You can enumerate anything that implements IEnumerable (this includes ICollection and IList implementations, since ICollection inherits IEnumerable and IList inherits ICollection ) this way.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles]
|
|
|
|