|
Dear All,
I am doing a project which needs to load different "child" Forms in a specific area in the Main Frame Form.
I tried to create a "child" Form instance inside the Main Form, and every time when Main Form move, it will update the "child" Form's location. But by using this method, the Form keeps flickering even "double buffering" is already enabled.
I am thinking that if it is possible to create a ControlContainer that can load the Forms accordingly, but I am new to C# and not sure what should do.
Anyone knows can please point out which area I should read or any place has the existing sample can refer?
Thanks a lot!
Best Regards,
Jacky Ha
|
|
|
|
|
I suppose your's is the fit case of MDI application. Set ISMDIContainer property of the Main form to true and load child forms as MDI Child
|
|
|
|
|
Hi, KrunalC,
Thanks for your reply!
Yes, this method can work if the Main Form and Child Form are standard ones.
In my case, the Main Form is a shaped Form (using Background Image and Transparent Color), so if set IsMdiContainer, the previously transparent Form Edge will have an edge now.
Another issue is that I only need a specific area in the Main Form to be able to load different "child" Forms. If set IsMdiContainer, it will apply to the whole Main Form. Is there any method to set its size and starting position?
Thanks again!
Best Rgds,
Jacky Ha
|
|
|
|
|
Do your child forms really need to be forms? Probably UserControl s or maybe even simple Panel s will be more suitable.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
Hi, Stefan,
You are right! I will try Panel first and then UserControl if Panel can't.
Thanks a lot!
Best Rgds,
Jacky Ha
|
|
|
|
|
Well!, i think if u made the main form MdiContainer and then make the other child forms childs for the main form u can get wat u need
here is wat u have to do
First for the main form "parent form" make the property
mainForm.IsMdiContainer = true;
and b4 u show the child forms u have to put this lines of code
childForm NewMdiChild = new childForm();
// Set the Parent Form of the Child window.
NewMdiChild.MdiParent = this;
// Display the new form.
NewMdiChild.Show();
i hope it helps
good luck
Keep Prayin
|
|
|
|
|
lo,
i want to change a cell constantly for example
for (int i = 0; i < 100; i++)
{
// the shown value of a certain cell, say column 1 row 3, is i
sleep 100; not sure about this either
}
so in the datagrid in column 1 row 3 i see a nr counting up to 100
and i dont want my datagrid to shake
anybody tips?
thx
|
|
|
|
|
Hi All,
I should write a help for my application in C#.NET at the command prompt.
And the format at command prompt should be
sample.exe /? or sample.exe/?
Plz provide me the code to write this and i should show some help abt what that appliaction do when i press sample.exe/? at command prompt..
Plz HELP!!
|
|
|
|
|
Change your main method so it looks similar to the following code snippet:
static void Main(string[] args)
{
if (args.Length != 0)
{
for (int index = 0; index < args.Length; index++)
{
if (args[index] == "/?")
{
return;
}
}
}
else
{
}
}
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
the parameters of the Main method are "string[] args".
that means that you receive the arguments the user gives you in the command line (arguments = the words after sample.exe).
if you want to check if you received /? in the command line, simple check what is the string in args[0].
if(args.Length > 0)
{<br />
if(args[0] == "/?")<br />
{<br />
}<br />
}
|
|
|
|
|
Thanks Stefan and Green!!!!
Both are working fine!!
|
|
|
|
|
I can get the current application window handle using the API
GetForegroundWindow()
From this handle I can get the caption of the window using the API
GetWindowText()
But, I need to know the name of the application that this window belongs too. Please help
thanks in advance.
|
|
|
|
|
|
Thanks for that. Unfortunately it seems to bring back the name of the c# process that im running and not the currently active process/window. Or am I missing something?
|
|
|
|
|
Hi,
Having searched the web without a conclusive answer I hope someone can advise.
I need to print an already created word document and at the same time set the printer name, tray, page orientation etc... for the printer the document is to be printed to.
I have used System.Diagnostics.Process... however this does not seem to allow the setting of the various printer items mentioned above, but does allow the printing of an already existing document.
System.Drawing.Printing does allow the setting of all these items but does not seem to allow the printing of an already existing document.
Microsoft.Office.Interop.Word seems to allow the setting of some of the printer settings but in a slightly different format (eg: setting the tray for page one to be different than for the rest of the pages is not quite what I want. I need to set the tray for document 1 then a different tray for document 2).
I am being led to believe from the MSDN forums that word documents can only be printed via the Microsoft.Office... libraries. Can anyone confirm whether that is true.
If it is true then am I missing something in the API because I would like to do the following:
Print Document 1 using tray 1
Print Document 2 using tray 2
However the API seems to only allow the following:
Print Page 1 of document 1 using tray 1
Print the rest of document 1 using tray 2
Print Page 1 of document 2 using tray 1
Print the rest of document 2 using tray 2.
Is this correct or can someone please advise/assist
Thanks in advance Andrew
|
|
|
|
|
Hi all,
I want to capture voice from the Microphone and then transfer that to another user.
I just want to know how do i capture voice from the microphone?
Are there any API's or methods to do that in .Net.
Thanks & Regards,
Pramod
"Everyone is a genius at least once a year"
|
|
|
|
|
You can do this very simply by using DirectX
it have libraries for ur request
good luck
Keep Prayin
|
|
|
|
|
i am using DirectX dll DShowNet
but could not find any method or interface for voice recording...
Can u please tell me where do i find them?
Thanks & Regards,
Pramod
"Everyone is a genius at least once a year"
|
|
|
|
|
Hi
I written a C++ unmanaged Dll. I tried to call the dll in C# Application. But I am unable to call the dll.
Kindly note the following points
1) I have used the namespace using System.Runtime.InteropServices;
2) I have used the [DllImport("dll1.dll")] to import the the dll in C#.
3) I tried add the dll in C++ using the Add Reference method.Using this method I was unable to add the dll to the project.
The dll is a Win32 Dynamic Dll.
Can any one tell how to write a dll in C++ that used imported to C# application ?
It is very urgent.
Thanks
Phijo Philip
|
|
|
|
|
You need to pinvoke it, that is, you need to import the methods you want to call, not just the dll. www.pinvoke.net has examples of how to do this with Win32 API calls, the approach for your own calls would be identical.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I write a dll in VB6.0, and call the dll in c# app.
the only thing I done is added the reference to c# app references.
(using 'Browse' tab in the 'Add Reference' dialog).
hoping this help.
|
|
|
|
|
lo,
i have an app with 2 datagrids containing the same database, but in one grid i like to see the hole data base, witch i already can; and in the other i only want to see certain values, for example:
every text with an h in it from column name.
i found a way to init the filter:
db1DataSet.tabel1.DefaultView.RowFilter = " name LIKE '%" + "h" + "%' ";
but noting happens, did i forget something?
and how do i make sure that he only changes datagridview2 and not 1?
if u know some links that could help, they are always helpful
thx
|
|
|
|
|
Hi,
setting RowFilter is definitely the way to go. Are you sure the grid is showing the DefaultView of the table?
You can create several DataView instances for the same table and assign them explicitely to the grids (instead of the DataSet). As the RowFilter is a property of the DataView you can set them separately on your both DataViews.
Robert
|
|
|
|
|
??
and how do you do that?
|
|
|
|
|
what exactly?
Creating DataView is easy with its constructor
DataView view = new DataView(myDataTable);
view.RowFilter = "...";
Assigning it to a grid is also straight forward:
myDataGridView.DataSource = view;
|
|
|
|