|
May i know why Multiple Inheritance is not supported in c#...
|
|
|
|
|
p_1960 wrote: May i know why Multiple Inheritance is not supported in c#...
The quick answer is because of the Diamond problem. Here's more information[^].
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
|
There were a number of problems with multiple inheritance. Read about diamond problem with multiple inheritance and C# solution to it.
|
|
|
|
|
|
Dear Developers...
I need to generate run time form IN MAIN(Mdi form)
which can contain few other forms...
simplified.
formMain(MDI)->form1(Mdi for form 2,3,4)->form 2,form 3,form 4...
it means form 2,3,4 will be open inside the form1 which is generated in Main Mdi.
Thanks
|
|
|
|
|
Could you please explain in detail? If you are using MDI form then you can already host multiple child forms in it. If you want them to opened by default all you need is to create their instances on application start and set their parent MDI container.
|
|
|
|
|
Dear Muhammad,
hierarchy is as follows.
grant parent->parent->Grant Children
form1->form2->form3..N
More Detail
In an MDI parent form I need to open multiple MDI forms which can hold multiple forms.
actually I need to create multiple workspaces where
I can open multiple forms within those workspaces.
If its not possible than i request you to give some other way to get this done.
Thanking you,
|
|
|
|
|
Give a try to following.
1)- create a new Windows Forms application for C#
2)- Right Click on soluton explorer and add new MDIParent form
3)- Update Program.cs files to point to this new MDI parent form
4)- Now edit the code of that MDIParent form and lcoate following mehtod
private void ShowNewForm(object sender, EventArgs e)
{
Form childForm = new Form();
childForm.MdiParent = this;
childForm.Text = "Window " + childFormNumber++;
childForm.Show();
}
and update it as below
private void ShowNewForm(object sender, EventArgs e)
{
Form childForm = new Form();
childForm.IsMdiContainer = true;
childForm.Text = "Window " + childFormNumber++;
childForm.Show();
}
Now when ever you will open a new form it will open a separate MDIForm that can hold its own childs.
|
|
|
|
|
You cannot do it this way. An form cannot be both an Mdiparent and an MdiChild form to another MdiParent at the same time.
|
|
|
|
|
Dear Sir
can you suggest me way to do it...
|
|
|
|
|
The only way to do anything close to that would be to create an instance of the child form, set its TopLevel property to false, add it to the parent form's Controls collection, then show with someFormInstance.Show().
|
|
|
|
|
Dear Sir,
We cant add forms in control collection...
Thanks
|
|
|
|
|
Wanna bet?? The Form class derives directly from the Control class.
|
|
|
|
|
I was using the following code to split textbox text by a single space character:
string words = notesTextBox.Text;
string[] splitWords = words.Split(new Char[] { ' '});
I now need to split the textbox text by either the space character or a carriage return. How can I do this please?
|
|
|
|
|
You can add chars to your array:
string words = notesTextBox.Text;
string[] splitWords = words.Split(new Char[] { ' ', '\r' });
2+2=5 for very large amounts of 2
(always loved that one hehe!)
|
|
|
|
|
If you need to split the text by a carriage return and/or space character, you can use the following code sample:
string words = notesTextBox.Text;
words = words.Replace("\r\n", " ");
string[] splitWords = words.Split(new char[] { ' ' });
This will replace all the carriage returns with spaces, then split the text at each space.
If you do what Moreno said and just add the '\r' and '\n' characters to the array, you will end up getting more split words in your array. You will have to try each way and see which best fits your needs.
string words = notesTextBox.Text;
string[] splitWords = words.Split(new char[] { ' ', '\r', '\n' });
modified on Monday, August 10, 2009 11:55 AM
|
|
|
|
|
Hai Friends,
I want to create a .net application that run on windows startup.
How can i create that.
Guide me with your Ideas.
Thanks,
Vasanth.A
|
|
|
|
|
Create a new registry key: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run and then add a new key-value (MyApp - C:\MyApp.exe)
using Microsoft.Win32;
private void CreateStartup() {
RegistryKey Key=Registry.LocalMachine.CreateSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run");
Key.SetValue("MyApp", Application.ExecutablePath);
}
|
|
|
|
|
I think you can also try to create a scheduled task.
|
|
|
|
|
I don't think that will help, schedular task, actually invokes a task or a bartch on a redefined time, its not responsive to windows startup. Its better to to add the entry in registry.
|
|
|
|
|
|
Hai Friends,
I want to make my .NET application into and Executable File.I dont't know how it was so help me.
Thanks Vasanth.A
|
|
|
|
|
???
If you compile your application, the compiler in VS create a .EXE file.
See in \Debug or \Release directory.
|
|
|
|
|
Go to Project->Your project Properties->Application tab->Output Type.
|
|
|
|