|
What does that have to do with threading?
Change the constructor of the subform2 to accept a reference to a form. When you create subform2 you pass along a reference either to the main form or subform1. Subform2 can then use that reference to set focus on subform1 either by accessing a method in the main form that does it or do it itself.
A refence to the main form would be the choise if subform1 doesn't have to be created before subform2 is.
---
b { font-weight: normal; }
|
|
|
|
|
But i dont know how make the refrence to another form.
please tell me briefly.
|
|
|
|
|
To show any form, you do something like:
<br />
MyForm myForm = new MyForm();<br />
The variable myForm is a reference. If you only have one of those, there will only be one form.
|
|
|
|
|
You probably have used it without knowing it...
The reference of the current form is easy to get. Just use the this keyword.
When you create a form you get a reference to that form:
Form f = new MyOtherForm();
When you create a form where you have modified the constructor to accept a reference, you just pass the reference when you create it:
Form g = new MySpecialForm(this);
or
Form g = new MySpecialForm(f);
---
b { font-weight: normal; }
|
|
|
|
|
Hi!
I have an applicatin that needs 2 forms. The first one is the login form and the next one is the main application form. What I need is to pass the login info from the first form to the main form. I've done that by creating for the main form a new constructor that gets 2 parameter, but I don't think it's a good ideea because when i'm creating an object of the main form from the login form if I close the login form the main form it's closing too. I've tried to hide the first form after initiating the main form, but then when I close the main form I can't (or I don't know how to) close the login form.
I would realy apreciate some sugestions. I'm a beginner in C#.
Thanks!
|
|
|
|
|
Open the login form as a modal dialog from the main form.
---
b { font-weight: normal; }
|
|
|
|
|
|
Create the form object and use the ShowDialog method to show it.
---
b { font-weight: normal; }
|
|
|
|
|
<br />
private void main_Load(object sender, System.EventArgs e)<br />
{<br />
LogingForm temp =new LogingForm(); <br />
temp .ShowDialog();<br />
if(temp .CheckLogin() == true)<br />
{<br />
}<br />
else<br />
{<br />
}<br />
}<br />
Tamimi - Code
|
|
|
|
|
hello.
i`ve loaded an assembly file (dll) through reflection and tried to create an instance of one of its classes using Activator.CreateInstance.
i got this message:
"Could not load file or assembly 'dll_test, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified."
please,help...
-- modified at 5:41 Saturday 3rd June, 2006
|
|
|
|
|
Well, it's really all in the error message. Either it can't open the DLL because there's something wrong with it (can't find it, it conflicts with another loaded DLL, etc.), or it has dependencies that can't be found.
Do you have the code for dll_test? Show us some code.
Also, are you just trying to load it once per app domain? Attempting to load it twice would give you an error like this.
|
|
|
|
|
hi
i have a swf file that contain 4 button.i want to work with them and implement 4 different reaction.
i use of following code:
but when i click on these button fscommand event dont call!!!!
private void axShockwaveFlash1_FSCommand(object sender, AxShockwaveFlashObjects._IShockwaveFlashEvents_FSCommandEvent e)
{
lbl_Result.Text="The "+e.args.ToString()+" "+e.command.ToString()+" was clicked";
}
|
|
|
|
|
Hi.
I have several xml files with a flat structure that I want to load into a class that I'm making. Is it possible to convert one of them into a framework of a class, so I don't have to do all the work manually?
Thanks in advance
Christian
|
|
|
|
|
There are tools that will infer XML schemas (XSDs) from XML data files. The .NET framework has these features built in as well. System.Data.DataSet.ReadXml() has an option to infer the schema, as well as to write the schema in the WriteXml() method. You could write a quick-and-dirty application that reads your file, inferring the schema, and writes it to a file. Once you have that, you can use the xsd.exe tool (or the version built into VS.NET) to build a typed DataSet, that will essentially act as a class.
If you need specific code, explain which part you're stuck at.
|
|
|
|
|
Stephan Samuel wrote: (or the version built into VS.NET)
Where do I find that tool?
_____________________________
...and justice for all
APe
|
|
|
|
|
Hi every one...
I have understood how to make a network chating program(send receive) using socket class but what could i do other than chating?..What is the next level? and could i perform it in the same way?
"I am too late but i will never give up"
|
|
|
|
|
You can 'do' anything you want. Since you only need client events to be triggered by some sort of nudge, you could quite easily code anything you want into it (game, service, event, literally anything) and have this triggered by specific information sent from the server or other client connected p2p, by your Protocol.
All you need to do is select/design the Protocol.
[edit]
What is next level? : limited by your imagination.
Could it ferform in same way? : Depends what you mean by perform? Bandwidth? Client side stress?, Server Stress? Client Connections? etc.
[/edit]
-- modified at 4:39 Saturday 3rd June, 2006
|
|
|
|
|
Thank you very much for these valuable informations.
Could you lead me to an article which could help me to make my knowledge about socket programming better..especially for understanding handling clients events.
"I am too late but i will never give up"
|
|
|
|
|
Hello!
i just started to write a windows service.
i put in the OnStart method the things i want to do, but it doesn't work..
any suggestion?
Thanks
Enrico
VentoEngine corp.
Program your life ^^
|
|
|
|
|
Enrico,
Unfortunately, writing a Windows Service isn't as easy as writing anything else in the .NET framework. You need an installer project to install your service. Once installed, it should at least show some signs of life.
ventomito wrote: but it doesn't work..
What part doesn't work? Do you get an error message? What does or doesn't happen, and what are you doing to try to get it to work? Can we see some of your code?
|
|
|
|
|
Hi,
Can anyboyd tell me how can i prevent user from Copy pasting text in Text Boxes and the Cells of a grid? Is there any way of doing that?
Wasif Ehsan.
|
|
|
|
|
Set the readonly property to true;)
VentoEngine corp.
Program your life ^^
|
|
|
|
|
How can I open a file in Autocad available on http://server using c# program.?
How can I savd a file in Autocad on http://server using c# program.?
How can i use the Stream in Autocad(file open and save using stream) in c#?
|
|
|
|
|
Hi All,
I have a program that wants to access a mapped network drive. When the program starts up it checks to see if the directory exists and then grabs the file.
The problem is that when i turn on my computer and start programming this bit of code does not work until I open up windows explorer and click on the drive. Once I have done this then the code works fine.
Is there a solution to 'wake' the mapped drive so that I have access to it?
Thanks in advance.
Stephen
|
|
|
|
|
Stephen,
Your problem isn't so much that it's sleeping, but rather that you're missing two steps that Explorer does: NetBIOS browsing and authentication. You may be able to avoid browsing if you're on an AD domain, but the authentication doesn't happen on its own.
For one, try accessing the machine from its UNC path (something like \\machinename\share\folder) instead of as a mapped drive. Drive letters are a vicious hack left in only for backwards compatability to the DOS days and for marketing/sales folks.
If that falls short, look at some of the documentation for the Linux SAMBA project. There are some pretty clear and simple descriptions there of exactly what steps happen when you double-click on a mapped drive.
|
|
|
|