|
Dear Satips,
I know very well what inheritance is. Here my problem class A has a method Method1 and Class B inherits class A and Class C inherits class B where Class C overides the Method1 and class D inherits class C. know when i call Methodi from class D the Method1 of class C will be called. but i want to call the Method1 of class A. We can use super keyword in C++. is there any thing in C# that helps us to acheive this? got this time you got it?
thanks in advance
Ramesh.Kanjinghat
|
|
|
|
|
Hello,
I think you have to do a little trick here.
In class C you need a additional method, which calls the base.Method (method from class A).
public override void MethodFromA()
{
}
public void BaseMethodFromA()
{
base.MethodFromA();
}
In class D you have to override the base method again and call the additional method in class C.
public override void MethodFromA()
{
BaseMethodFromA();
}
Maybe there is some cleaner solution, which I'm not aware of, but I think it will work!
All the best,
Martin
|
|
|
|
|
|
|
No, not once the method has been hidden (with override or new ).
|
|
|
|
|
I am developing a dynamic DataGridView Control but the default columntype is DatagridviewTextBoxColumn I want to change it to DataGridViewCheckBox column.
Need help
![Rose | [Rose]](https://codeproject.global.ssl.fastly.net/script/Forums/Images/rose.gif)
|
|
|
|
|
Hi,
Here is the code snippet:
private void Form1_Load(object sender, EventArgs e)
{
DataGridView dgrid = new DataGridView();
DataGridViewCheckBoxColumn col = new DataGridViewCheckBoxColumn();
col.DataPropertyName = "check";
dgrid.Columns.Add(col);
DataTable dt = new DataTable();
dt.Columns.Add("check");
DataRow dr = dt.NewRow();
dr["check"] = true ;
dt.Rows.Add(dr);
dgrid.DataSource = dt;
this.Controls.Add(dgrid);
}
Thanks,
Gopal.S
|
|
|
|
|
Thanks for reply.......
Actually I have predefined no.s of rows and columns in a datagridview and all the columns are textboxtype I want that when i click a cell it will automaticaly convert to datagridviewcheckboxcell.
your help be truly appreciated...
![Rose | [Rose]](https://codeproject.global.ssl.fastly.net/script/Forums/Images/rose.gif)
|
|
|
|
|
Greetings,
I am currently coding some small-scale automation tools for my department and have been running into some issues as I am a beginner to Win32 coding.
I need to read and parse the text from another application's StatusStrip. I am assuming it's a StatusStrip as sending either an SB_GETTEXT or WM_GETTEXT message to the control's handle retrieves nothing. However, it may be a custom control as getting the child windows of this control only returns a handle to a StatusBar Progress Bar control.
I am hoping that it is not a custom control and I am just missing some reason as to why the ToolStripStatusLabels are not showing up as children of the StatusStrip control.
I have also been having issues trying to read from a ListView in this app, but I believe it's a custom control as well because I have no issues reading from another app's ListViews by virtually allocating memory and all of that jazz.
I do know that the app I'm having difficulty with uses a lot of the newer .Net controls that the other app's don't.
So, if anyone has any insight as to how I would retrieve the text from another app's StatusStrip, I would be extremely grateful.
Thanks,
Damien
|
|
|
|
|
Please find the keyword "object inspector" in codeproject search. there are a lot of articles (eg: this one).
try to inspect StatusStrip Text by using those programs. if those programs can read the text that you want then you can find out how those programs work ...
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
thank you so very much. was unable to find programs of this nature before. i guess i just didn't know where to look .
this will help a lot for everything i am doing.
once again, thanks!
|
|
|
|
|
The documentation for OpenIcon says that it will restore a window to its previous size and location. This isn't happening - it is restoring the window but not to its previous size. Is there something extra that needs to be done when calling it from C#? The ReturnValue indicates success.
<br />
[DllImport("user32.dll")]<br />
static extern bool OpenIcon(IntPtr hwnd);<br />
<br />
...<br />
<br />
IntPtr wHandle = process.MainWindowHandle;<br />
bool ReturnValue = OpenIcon (wHandle);<br />
|
|
|
|
|
Im a beginner with C#.I want to create a program to store students and courses, each student can have one course at a time and a course can belong to two students or one..
I have microsoft access to create the classes and import them to Visual Studio 2005..
Im using visual studio 2005 and I want to find out the easiest way of doin these sort of programs, programs that can be used to store data, manipulate it and delete it.
As I have said this is probably an easy task for most but Im struggling..
Im very familiar with java(inheritance, polymorphism, generics and other things relating to classes) but I want to use C#...
Please help..
Is this chair taken
|
|
|
|
|
Bonsta wrote: Im very familiar with java(inheritance, polymorphism, generics and other things relating to classes) but I want to use C#...
OK - then you shouldn't have too much trouble, the syntax is similar, and I'm sure there's plenty of articles, even on this site, that cover the DB basics.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Can anyone explain me what an inline procedure is ?
|
|
|
|
|
I didn't think there was such a thing in C#. In C+, inline is a compiler suggestion.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Christian Graus wrote: I didn't think there was such a thing in C#
There is but you have no control over it, it's something that the JIT compiler does if it deems it necessary.
|
|
|
|
|
Just like C++ then ? :P
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Yep , I'm not even sure you can find out when it's been JITted, I remember someone a few years ago having real trouble tracking down a bug and it was eventually sussed out that the method had been inlined. This might have been in a beta version though.
|
|
|
|
|
i want to use splitter control in vc# 2005, but how to do ?
thanks
|
|
|
|
|
Drag and drop it from toolbox on your form
|
|
|
|
|
you joking!?
i know this, but i don't know how to set it's properties and attributes ?
|
|
|
|
|
You set it's properties just like you would with any other control. Is this .NET 2.0? If so, you automatically get two panels (a left and right, by default) that you can then drop other controls onto.
If it's earlier than .NET 2.0, you need to drop a panel on the form, drop the splitter control, and then drop another panel. If I remember correctly, the splitter will automatically dock left...if not you will need to set the dock properties by hand. After that, you just drop controls onto the respective panels.
-----------------------------
In just two days, tomorrow will be yesterday.
|
|
|
|
|
1. Drop the control you want on the left hand side on the form, and dock it left.
2. Drop the splitter control on your form (it will dock to the left automatically).
3. Drop the control you want on the right hand side on the form, and dock it fill.
That should be it.
- S
50 cups of coffee and you know it's on!
|
|
|
|
|
There are actually 2 different controls that provide similar functionality. There is the 'legacy' splitter control that is the same as the previous versions of visual studio. You have to drop a panel, then the splitter, then another panel.
The better control, IMO, is the SplitContainer. This shows up with a default left and right panels already configured. You can change the orientation so it is top and bottom. It is a container control so you can drop pretty much whatever you want inside of the contained panels.
You'll most likely want to set the minimum sizes for the panels (property names will be Panel1MinSize and Panel2MinSize. This will keep the user from shrinking them too far.
I hope that helps a little.
Pete
|
|
|
|