|
Tavbi wrote: can I with CreateInstance create instance of form that requires parameters?
Have you read the documentation for CreateInstance[^]?
Perhaps this[^] will help.
|
|
|
|
|
I read, but I still have problem.
Can you give me solution for my example, please?
thanks
|
|
|
|
|
Something like this:
Type type = Type.GetType("MyNamespace.MyFormName");
object[] args = new object[1];
args[0] = new DSBasis();
Activator.CreateInstance(type, args);
|
|
|
|
|
Thank you Colin, it works.
|
|
|
|
|
Hi all,
After converting application from C#.net 2003 to C#.net 2005 the following error comes.
ActiveX control '6bf52a52-394a-11d3-b153-00c04f79faa6' cannot be instantiated because the current thread is not in a single-threaded apartment.
pls. suggest solution
Thanks.
|
|
|
|
|
i have Setup of Project. i want to make a licence key after installing the Setup project. After giving the right licence key, then project or exe file should Start. I have no idea about that. please give me some ideas.
thanks.
Sanjit.rajbanshi@wlinktech.com
|
|
|
|
|
I Have a problem of memory leakage.
and i m using COM objects in the page which will not free memory.
so How To Free Memeory of COM object?
Best Regards,
Chetan Patel
|
|
|
|
|
Release it.
Make the object NULL.
Cheers,
Suresh
|
|
|
|
|
I have already try that but still i found problem of memory leak.
please give me another solution.
|
|
|
|
|
maybe a bit of a hardcore solution, but you could instantiate your COM object in a separate application domain and when you don't need the COM object anymore drop the application domain, that should take care of the memory issue I think...
Greets,
Davy
|
|
|
|
|
Have you tried this:
System.Runtime.InteropServices.Marshal.ReleaseComObject(yourObject);
before you set your COM object to null?
|
|
|
|
|
Hello!!!!
I'm working with RichTextBox.
How can i make that if i push right button, the text (or only 1 position), that is under my cursor became Selected ? (as if i press left button ?).
One nation - underground
|
|
|
|
|
check the key event.
Keshav Kamat
India
|
|
|
|
|
|
HELLO, PRASAD.
this might be happenin because of the location of mouse.
you can use datagrid paint method and in that you have to write
MaskedTextBox Ma=new MaskedTextBox("0.0.0.0");
Ma.Top=grdPrescription.GetCurrentCellBounds().Top;
Ma.Left=grdPrescription.GetCurrentCellBounds().Left;
Ma.Width=grdPrescription.GetCurrentCellBounds().Width;
Ma.Height=grdPrescription.GetCurrentCellBounds().Height;
...
manas
|
|
|
|
|
i was just trying to solve it in my application.
dont worry abt "grdPrescription", its the name of the datagrid.
manas
|
|
|
|
|
Ew.
Instead of magically showing a masked text box over the cell that has been clicked, you may consider actually creating a masked text box CELL -
This requires creating a column and corresponding cell of your specific control type.
Here is a great tutorial on how to do this, I have used it to create several custom column and cell types:
http://msdn2.microsoft.com/en-us/library/aa730881(vs.80).aspx[^]
Yes, it is more work, but you get 3 things for free:
1. The grid will automatically show the control in the correct place.
2. The control can be databound, meaning it takes care of all the data transactions for you
3. It keeps your business code simpler by not involving the management of temporary text boxes.
------------
Cheers,
Patrick
|
|
|
|
|
Dear All
I am working on a drawing application using OpenGl and C#. I want to use the whole form as Drawing area, i have added menus to my application but these menus does not show at run time, help required
thanks
David
-- modified at 4:48 Tuesday 24th April, 2007
david
|
|
|
|
|
hi,
i want to extract only the class names from a C# file..
i have a pattern like this..
pattern: "\\s*(namespace|class)[^{]*"
but it gives matches along with the namespace and class keyword..
i want a pattern that can extract only class|namespace names from
the lines that are not commented in the source code..
plz help.
regards,
nas
|
|
|
|
|
Hi
Not sure if this was already asked, but I'm trying to find a way to get a certain text (or phrase) from a line in notepad using C#
example: (notepad)
>Name: Joseph Smith
>Address: Main Street
I need to get name (Joseph Smith) and the address only, ignoring the "name:" and "address:"
so far i only know how to read the entire line, but i have no idea how in the world i can isolate the desired text/phrase
Hope you guys can help. Thanks
|
|
|
|
|
If you can rely on a standard line format, it's pretty easy:
string line = "Name: Joseph Smith";
string[] parts = string.split(line, ":");
Then the parts[] array will contain the following strings:
parts[0] = "Name"
parts[1] = " Joseph Smith"
Note the space before Joseph. You could use string.Trim() to get rid of that, or you can modify the split to use StringSplitOptions.RemoveEmptyEntries.
I'm assuming you're using C#, here.
------------
Cheers,
Patrick
|
|
|
|
|
Why don't you try a xml file?
|
|
|
|
|
He specifically said he's getting a line from a text file in notepad and gave an example line. XML works nicely, yes, but unfortunately not everyone uses XML to store application information
------------
Cheers,
Patrick
|
|
|
|
|
Patrick Sears wrote: If you can rely on a standard line format, it's pretty easy:
string line = "Name: Joseph Smith";
string[] parts = string.split(line, ":");
Then the parts[] array will contain the following strings:
parts[0] = "Name"
parts[1] = " Joseph Smith"
Note the space before Joseph. You could use string.Trim() to get rid of that, or you can modify the split to use StringSplitOptions.RemoveEmptyEntries.
I'm assuming you're using C#, here.
------------
Cheers,
Patrick
Hi Patrick! thanks for the help. Yes, im using C#, but i received this error
"Error 1 'string' does not contain a definition for 'split'" for string[] parts = string.split(line, ":");
do i need to import something?
thanks again
|
|
|
|
|
Split isn't a static method.Use in in a object instance and take care of the case.
|
|
|
|