|
|
I want help in opennig only one child file at a time. My application irritates me when there are too many child forms open.
I added this code (on all the menu items) to open only one, but the problem is that, I can't open another child while there is a child active. How do you control that ?
Interfaces - Is the folder Name where all forms are located
frmPerson - is the child form (requered form to open)
private void mnuManagePerson_Click(object sender, System.EventArgs e)
{
if (Interfaces.frmPerson.ActiveForm.ActiveMdiChild == null)
{
Form frmchildfrmPerson=new Interfaces.frmPerson();
frmchildfrmPerson.MdiParent = this;
frmchildfrmPerson.Show();
}
}
Cool Joe
"Only the best"
South Africa
-- modified at 5:12 Friday 17th March, 2006
|
|
|
|
|
Make the base class of your child form to implement the singleton pattern
|
|
|
|
|
hi all i have a sample code this will solve your problem
take a form and ToolStripMenuItem from vs toolbox
duble click on opentoolstrip and write these code
private void openToolStripMenuItem_Click(object sender, EventArgs e)
{
openToolStripMenuItem.Enabled = false;
Form2 frm = new Form2();
frm.MdiParent = this;
frm.FormClosed += new FormClosedEventHandler(frm_FormClosed);
frm.Show();
}
void frm_FormClosed(object sender, FormClosedEventArgs e)
{
openToolStripMenuItem.Enabled = true;
}
|
|
|
|
|
How do i manipulate hashtables in c# ? i could store objects into hastables but i get problem while retrieving them back.
i tried this :
<br />
Dictionary<string, string> openWith = <br />
new Dictionary<string, string>();<br />
[here i intend replace "string" with my own object type]
but it failed,
may be because it failed even when i tried to include this
using System.Collection.Generic;
it says like "are you missing any assembly reference?"
BTW, just like we have vectors in C++, what's the equivalent container in C# ?
VuNic
|
|
|
|
|
Hi
It's System.Collections.Generic for a start.
----------------------------
Be excellent to each other
EasiReports[^] My free reporting component for WinForms.
|
|
|
|
|
oops , sorry i typed it wrong there.
it is actually System.Collections only.
VuNic
|
|
|
|
|
A potentially dangerous Request.Form value was detected from the client.
I have a webpage using .net 2.0 with
an asp:button Back and
a textbox with text = "<space>"
I've done my research and everything I see says set ValidateRequest="false" in page directive which I did.
There's no problem if I click the browsers back button. But when I click my own asp button BtnBack, the error is produced. Is there something like setting the validation within my own button?
Thanks!
|
|
|
|
|
Hi,
When browser back button is clicked, no new request is sent to browser, I think(unless we expire the page programmatically). Most probably, you have written a Response.Redirect in your asp button click, right? So, the html code gets posted to the server and server generates the error.
You can either call History.Back(or something like that in javascript) in your button click or you can set ValidateRequest = "True"
Regards,
Jim
|
|
|
|
|
A potentially dangerous Request.Form value was detected from the client.
I have a webpage using .net 2.0 with
an asp:button Back and
a textbox with text = "<space>"
I've done my research and everything I see says set ValidateRequest="false" in page directive which I did.
There's no problem if I click the browsers back button. But when I click my own asp button BtnBack, the error is produced. Is there something like setting the validation within my own button?
Thanks!
|
|
|
|
|
I have bound a "Decimal" field to my DataGridView control.I've gotten precision and scale of this column's value but i am in wonder how to get these values declared in SQL for this field?
Thanks and waiting for your replies ...
|
|
|
|
|
select numeric_precision, numeric_scale
from information_schema.columns
where table_catalog = 'MyDatabaseName'
and table_name = 'MyTableName'
and column_name = 'MyColumnName'
|
|
|
|
|
Hi there,
I have an urgent need for help. I'm currently on a project where I'm developing an Indigo service
(CTP Feb 2006) which is hosted in IIS 6.0 on a Windows 2003 server. This service needs to access a COM component.
First, I tried registering it on the server (regsvr32) and accessing it, but I always get E_NOINTERFACE.
Second I tried to isolate the component and deploy it with a manifest.
But it still doesn't work. I get another COM error (Sorry, don't remeber the actual number but it was something like 80040154).
Now I actually have two questions:
1. Can anyone tell me what I'm doing wrong, and
2. Does anyone know if the isolation of COM components is possible on W2K3 server.
Many thanks in advance
|
|
|
|
|
Good day to all,
Currently im developing an administrative tool that allows me to monitor all workstation under my domain. I want to do remote shutdown/restart/log-off using C#. At first I was thinking of executing the ff:
shutdown -r -f -m \\pcname -t 0 for restart..
shutdown -s -f -m \\pcname -t 0 for shutdown..
I planned to execute it under C# Process & ProcessStartInfo however i feel i doesnt much have control because whenever i shutdown/restart an offline pc, if it is on command line, then it will just hang-up or just a cursor blinking and will not exit the command (maybe it would take too long..). I hope somebody could help me find a way to execute shutdown/restart/log-off remotely which we have better control and more reliable way. Also also want to get remotely,the processes that runs under the client machine/workstation, i hope this is feasible in C#.
Im using .NET 2003 environment,
thanks a lot,
-- modified at 2:39 Friday 17th March, 2006
|
|
|
|
|
Try this :
string t = "-r -c \"I am going to reboot your mechine\" -t 20";
Process process = new Process();
process.StartInfo.FileName = "shutdown.exe ";
process.StartInfo.Arguments = t;
process.Start();
I think this will solve your problem.
Cheers
Jijo
|
|
|
|
|
Hi Jijo,
Thanks for your reply. I guess i will just have to use shutdown.exe and continue using Process and ProcessStartInfo.
More power to you!
|
|
|
|
|
Hello, I would like to know how to embed an application into a window form using framework 2.0.
anyhelp will be appreciated. Thanks
|
|
|
|
|
i have a .net component which is registered for com interop. now when i install the the setup. it stores the file under program files. But i want to add this .net component to GAC on Target server. How can i do this? is there any code to do this?
|
|
|
|
|
Hello,
I'm working on a localized project and have the following problem now:
PROBLEM:
The Visual-Studio-2003-Designer does not show the correct language. What i did is that:
WAY:
1. Create a new WindowsForm-Project and place a button on the form.
2. Add a new userControl and place a button in the userControl (compile it).
3. Place the userControl on the Form.
4. Localize the project to "invariant", "german", "english"... (compile...)
I named all buttons according to the localized language (invairant, german, english).
EFFECTS:
When I now open the Form with the designer, and the language of the Form is set to "invariant", the button of the form is named "invariant" but the button of the control is named "german". It doesnt matter in wich language set when I compile the userComponent. Most of the time it's "german" (sometimes I saw "invariant" but I couldnt figure out why ).
During runtime everything works normal and I can see the language that is set in "System.Threading.Thread.CurrentThread.CurrentUICulture".
PRESUMPTIONS:
I suppose that it may depend on the language of the Visual Studio or on the language of Windows (both is german in my case). But I would like to understand WHY EXACTLY this happens (and what I can do to prevent it).
Thanks in advance
Snow
|
|
|
|
|
how can i use a assembly(dll) reference in runtime?
|
|
|
|
|
vatzcar wrote: how can i use a assembly(dll) reference in runtime?
Have a look at the Assembly class. You can load an assembly with Assembly.LoadFile() and get its types with Assembly.GetTypes(). Activator.CreateInstance() will create an object of a given type.
Does that answer your question?
Cheers,
Vikram.
I don't know and you don't either.
Militant Agnostic
|
|
|
|
|
Vikram A Punathambekar wrote: Does that answer your question?
Yes. and thanx a lot for the help
|
|
|
|
|
Hi ,
I am using couple of pages with a master page in asp.net application.
one of the page works fine when i debug the application but when i am debuggifn another page i get the error.
"Session state can only be used when enableSessionState is set to true, either in a configuration file or in the Page directive. Please also make sure that System.Web.SessionStateModule or a custom session state module is included in the <configuration>\<system.web>\<httpmodules> section in the application configuration"
Could anyone help me on this.
If i run the application as a published website,it works fine but once i go to debug mode, it shows an error on the line in master page where session["user"] is there.
this error is not shown wnhe debuggin another page of same application.
Regards,
Sama
|
|
|
|
|
Hi
I am using ASP.NET and C#. When I load imgae from the directory mydocuments/mypiactures, it works fine. but when load that image from any other location it gives error. below is the code:
Image1.ImageUrl = "";
bmp = new Bitmap(Upload.PostedFile.FileName);
h = bmp.Height;
w = bmp.Width;
if ((h == 133) && w == 274)
{
int len = Upload.PostedFile.ContentLength;
string imgtype = Upload.PostedFile.ContentType;
string imgtitle = "Logo";
byte[] imgdata = new byte[len];
Upload.PostedFile.InputStream.Read (imgdata, 0, len);
Image1.ImageUrl = Upload.PostedFile.FileName;
//Insert the image and comment into the database
companyDetails.InsertLogo(imgtitle, imgtype, imgdata, 1);
....for example if i load image from desktop it will give error. I think that asp code does not have access to personal files or folders. IF that is the reason then how do we give acces to personal files and folders.
Deepak Anish
Computer Programmer
Maxumise Fiji Ltd
Suva, Fiji
|
|
|
|
|
hi
I want to collapse and expand categories in the property grid.The proeprty grid allows me to expand/collapse all the categories but my requirement is to expand/collapse some categories.
Any suggestions
-- modified at 23:34 Thursday 16th March, 2006
|
|
|
|