|
Hi,
Works for me with the following code where Form1 has one button.
public partial class Form1 : Form {
public Form1() {
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e) {
Form1 f = new Form1();
f.ShowDialog(this);
}
}
How are you creating and showing the forms?
Alan.
|
|
|
|
|
PosiRob wrote: C# says it can't launch a modal form from a modal form.
What are you telling?
How are you opening a modal form. Is it using
form.ShowDialog() [ where form is an object of your form ]
By this way you can open as many modal forms as you want.
|
|
|
|
|
Thanks for the quick replies. I created a simple application to test your comments, and it proves you are right.
I get the run time error when I want the modal form to be a child in an MDI application, and I misinterpreted the error message.
Problem solved, thanks again.
Rob
|
|
|
|
|
You are most welcome.
you can also rate the answers if it really helped you ..
|
|
|
|
|
I have a large xml document and I am extracting out individual nodes from it. I don't want any manipulation.
its like
start-large
start-small
.
.
close-small
start-small
.
.
close-small
and so on.
It works fine if I do.
XmlDocument xmlDoc= new XmlDocument();
xmlDoc.Load(xr.ReadSubtree());
xmlDoc.Save("c:\\one.xml");
But for the following the XMl document I get it messed up.
XmlTextWriter xw = new XmlTextWriter("C:\\two.xml", null);
xw.WriteNode(xr.ReadSubtree(), true);
I get errors like "end element missing" or "not properly closed".
What am I doing wrong in case of text writer? xr is the xmltextReader which is reading the large file.
Your help is appreciated.
|
|
|
|
|
Check if all your begin tags have closing tags in your XML file.
|
|
|
|
|
can someone explain if i need to use all the three lines of code mentioned below to disable the cache in a page.actually if i am using only Response.CacheControl = "no-cache" then also page is working properly.then what is the use of another two line..and also is it a server side cache or client side?
Response.CacheControl = "no-cache"
Response.AddHeader("Pragma", "no-cache")
Response.Expires = -1
|
|
|
|
|
If you are talking about ASP.NET, then please post it in ASP.NET forum
|
|
|
|
|
How i can get Hardware seail number of hard disk byc# code?
|
|
|
|
|
If you google using serial instead of seail, you will find many results.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
mht2008 wrote: How i can get Hardware seail number of hard disk byc# code?
You can read it easily using WMI .
Try this
using System.Management
Public string GetHDDSerialNumber(string drive)
{
if (drive == "" || drive == null)
{
drive = "C";
}
ManagementObject disk = new ManagementObject("win32_logicaldisk.deviceid=\"" + drive +":\"");
disk.Get();
return disk["VolumeSerialNumber"].ToString();
}
Source : Use WMI to get HDD's serial number
Note : You have to add System.Management.Dll from Reference
[EDIT]
For Exploring WMI : Please Download WMI Code Creator
[/EDIT]
Hope this will help you
|
|
|
|
|
|
Thanks
|
|
|
|
|
|
How i can export and import sql server 2005 database by c# code?
|
|
|
|
|
Not being funny but maybe buying a book would help??
Excellence is doing ordinary things extraordinarily well.
|
|
|
|
|
Any reason you specifically want to do it in C#? SSIS is probably more suited for what you're looking to do.
Cheers,
Vikram. (Proud to have finally cracked a CCC!) Recent activities:
TV series: Friends, season 10
Books: Fooled by Randomness, by Nassim Nicholas Taleb. Carpe Diem.
|
|
|
|
|
How about looping all tables from the database. (export)
Saving them in an xml document. (export file)
And then saving them back to another database. (import)
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
How i can define dyamic array in c#?
|
|
|
|
|
Use a List?
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
System.Collections.ArrayList al = new ArrayList();
Then for every element you want to add just use the a1.Add method.
|
|
|
|
|
Only if you are forced to use .NET 1.1
|
|
|
|
|
As HArold said, only if forced to use 1.1. The problem with an ArrayList is it requires every object to be converted to and from object (boxing/unboxing). A List<T> gives the same functionality, but without that overhead and inconvenience!
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
Ah, okay, gotcha! I was typing asking why it was bad!
Thanks for the tip!
|
|
|
|
|
I have made a custom Scroll Bar somewhat like the one here How to skin scrollbars for Panels, in C#[^].
My Goal is to insert this control inside of a treeview and get rid of the standard scrollbar. I have been working and looking around for answers for two weeks. Could someone please help me out or at least point me in the correct direction
Mike
|
|
|
|