|
I Create Login From And MDI Form for a project
my requirement is view a mdi form after giving user name and password on user from,
but the problam is when i close the login form the mdi form also disposed how to overcome this problem
|
|
|
|
|
The reason this happens is because your Main method in Program.cs contains Application.Run(new LoginForm()); . This means that the Windows message loop is tied to your login form. The best thing to do is to show your login form as a modal dialogue, and if login is successful, you show your mdi form, like this:-
static void Main()
{
LoginForm login = new LoginForm();
if (login.ShowDialog() == DialogResult.OK)
{
Application.Run(new MdiForm());
}
else
{
Application.Exit();
}
}
Hope this helps
When I was a coder, we worked on algorithms. Today, we memorize APIs for countless libraries — those libraries have the algorithms - Eric Allman
|
|
|
|
|
I have created a console app where it will finally create a text file. Everything run well when I run the program manually but not when I used scheduled task to run it.
Anyone know the reason?
|
|
|
|
|
You haven't described what goes wrong, so how can anybody guess what could be the cause?
Have you run the program in the debugger?
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
When run with scheduled task, .exe run properly but it doesn't create text file as writen in codes.
It run well and a text file create when I run it manually.
|
|
|
|
|
Maybe it is a permissions issue. Is the scheduled task running as the same user as when run manually?
Have you attached a debugger to it when it's run as a scheduled task?
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
You DO have an exception-handler that catches and logs unhandled exceptions?
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
Eddy Vluggen wrote: You DO have an exception-handler
That's certainly funnier than the so-called jokes in the Soapbox.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Does the task scheduler display an error code next to the task when it runs? Also, check the Application event log around that time and see if there are any errors (although as Eddy mentioned, it's a very good idea to catch any exceptions and log them for later debugging - but the Event Viewer might display the exception as well).
The shout of progress is not "Eureka!" it's "Strange... that's not what i expected". - peterchen
|
|
|
|
|
Also make sure nothing else has the text file open when the scheduled task runs.
The shout of progress is not "Eureka!" it's "Strange... that's not what i expected". - peterchen
|
|
|
|
|
Hi all,
If I were an employer searching for resumes which contain skill sets that match my search criteria, how is that done from a programmer's perspective. Can we actually go inside of text documents in a database and search their contents? If not, I will have to add a Skills field to the database so that it can be searched. Any suggestions will be greatly appreciated, thanks in advance.
|
|
|
|
|
ASPnoob wrote: Can we actually go inside of text documents in a database and search their
contents?
Maybe. It depends on the datatype. For instance, if they are stored as VARCHAR(MAX) then you can use something as simple as LIKE .
You might get better answers in the database forum.
|
|
|
|
|
Hi PIEBALDconsult, thanks for responding. I will post this question in the Database forum as you've suggested.
|
|
|
|
|
Hi,
For a WinForm (C#) application, how can I have a search textbox similar to the facebook search textbox with a watermark text (type customker name)?
Thanks
|
|
|
|
|
You could check the properties of the textbox object to see what options are available. However your question is not very clear, please give more detail of what you are trying to achieve.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
See this[^] article.
/ravi
|
|
|
|
|
hello guys
i using C# and action script 3 .
and write code in action ascript 3
<pre lang="c#">function callingme(itemp:String):String
{
temp=int(itemp);
myDelay.start();
return "";
}
ExternalInterface.addCallback("callingme",callingme);
</pre>
and i called it in c# The following figure:
<pre lang="c#"> string com = "<invoke name=\"callingme\" returntype=\"xml\"><arguments><String>" + temp.ToString() + "</String></arguments></invoke>";
flash_argham.CallFunction(com);
</pre>
but I encountered with error The following figure :
Error HRESULT E_FAIL has been returned from a call to a COM component.
note: this code it work in action script 2 but not work in action acript 3.
pleas help me
hamed development
|
|
|
|
|
You may wish to start here[^]. I'm guessing that there were changes to the interface implemented between the two versions, so you'll probably have the make some changes in the way you make your calls. I don't know actionscript, but I know COMs, so hopefully this can help you along the way.
I wasn't, now I am, then I won't be anymore.
|
|
|
|
|
Hi all,
i`m a visual foxpro developer and started to learn develop windows applications in C#.
How i can create menu in XML and when user login to database (MSSQL), system will grant access to options based on user rights ?
My idea is to create form for sys admin create users and rights by ticking Y for each options in system.
Thanks,
Jeff.
|
|
|
|
|
|
This is something I'm doing:
<pre lang="c#"> private void GetPrinterInfo()
{
try
{
ConnectionOptions objConnection = new ConnectionOptions(); objConnection.Username = "TempAccount"; objConnection.Password = "jkkkllk"; objConnection.Authority = "ntlmdomain:Companydomain"; ManagementScope objScope = new ManagementScope("\\\\192.168.0.6 \\root\\cimv2", objConnection); objScope.Connect();
SelectQuery selectQuery = new SelectQuery(); selectQuery.QueryString = "Select * from win32_Printer"; ManagementObjectSearcher MOS = new ManagementObjectSearcher(objScope, selectQuery); ManagementObjectCollection MOC = MOS.Get(); foreach (ManagementObject mo in MOC) { cbbPrinters.Items.Add(mo["Name"].ToString().ToUpper());
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Exception Message", MessageBoxButtons.OK, MessageBoxIcon.Error); Logger.LogError("ucSysParameter", "GetPrinterInfo", ex.Message);
}
}
I keeps getting error message "The RPC Server is unavailable. (Exception from HRESULT: 0x800706BA)". Can anyone help? Thanks!
|
|
|
|
|
Verify that all required services on the target-computer are running. See this[^] list of points.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
That could be a firewall setting on the "server" (192.168.0.6). Disable the firewall completely for testing purposes; if it works, configure the firewall so that it accepts WMI.
|
|
|
|
|
let say it the first time i am using C# what is recommended between starting a new page and or continuing with the temp-let form C#?
|
|
|
|
|
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind.
Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water
|
|
|
|