|
Thanks a lot! indeed i was not considering that point. I should better catch event of folder opening in some way coz any body can open the folder in any way even by pressing enter button in key board!!
so any body can help me how to instantiate an application when someone tries to open a folder???
Thanks again..SK
May God help u solv ur problems as well,thx in advance!!
|
|
|
|
|
how to implement multilevel inheritance in c#
Yogesh Pekhale
pekhaleyogesh@gmail.com
|
|
|
|
|
Do you mean where a class is derived from more than one class ? You can't, interfaces are as good as it gets.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
//abstract base class
abstract class base
{
//some abstract method
}
//abstract Derived1 class
abstract class Derived1 : base
{
//
}
class BaseDerived : Derived1
{
}
shall i do the thing?
Yogesh Pekhale
pekhaleyogesh@gmail.com
|
|
|
|
|
Abstract methods in the base class should be overridden in the Derived1 class. And I don't think that you can name the class as base since it is reserved word.
|
|
|
|
|
you can inherit your classes like this.
there's no problem in it except the name's (as mentioned by ...)
|
|
|
|
|
tnx
Yogesh Pekhale
pekhaleyogesh@gmail.com
|
|
|
|
|
If you're not talking about multiple inheritance, then it's a simple matter:
public abstract class ReallyAbstractBase
{
int _value;
public ReallyAbstractBase(int value)
{
_value = value;
}
public int Value
{
get { return _value ; }
}
public abstract void DoSomething() ;
}
public abstract class MyAbstract : ReallyAbstractBase
{
protected string _text;
public MyAbstract(int value) : this(value, string.Empty) {}
public MyAbstract(int value, string text) : base(value)
{
_text = text;
}
public virtual void DoSomething()
{
throw new Exception("Not implemented");
}
}
public class ConcreteClass : MyAbstract
{
public ConcreteClass() : this(0, string.Empty) {}
public ConcreteClass(int value) : this(value, string.Empty) {}
public ConcreteClass(string text) : this(0, text) {}
public ConcreteClass(int value, string text) : base(value, text) {}
public virtual void DoSomething()
{
Console.WriteLine("Do something called");
}
} This is the way that lots of classes work in the .NET framework, with each lower level class becoming a more specialised version of the level above.
|
|
|
|
|
If your MyAbstract classes DoSomething() method doesn't do anything, how about rewriting it like
public abstract class MyAbstract : ReallyAbstractBase
{
protected string _text;
public MyAbstract(int value) : this(value, string.Empty) { }
public MyAbstract(int value, string text)
: base(value)
{
_text = text;
}
public override abstract void DoSomething();
}
public class ConcreteClass : MyAbstract
{
public ConcreteClass() : this(0, string.Empty) { }
public ConcreteClass(int value) : this(value, string.Empty) { }
public ConcreteClass(string text) : this(0, text) { }
public ConcreteClass(int value, string text) : base(value, text) { }
public override void DoSomething()
{
Console.WriteLine("Do something called");
}
}
|
|
|
|
|
Fair point, although I was only trying to knock up a quick example.;)
|
|
|
|
|
Even that is too much Since MyAbstract is abstract you can leave the DoSomething declaration out of it
|
|
|
|
|
hi
i have a pictureBox that show my .gif image on the form.
i want to change transparency of my .gif image but how to do ?
thanks
|
|
|
|
|
I believe to do that, you have to draw it on your form yourself. I don't know that a picture box can draw transparently. I may be wrong
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I think all controls have the ability to draw transparently, but in some cases you have set something before it will actually do it. I don't quite remember.
Transparency isn't so great in .Net, it works by the control getting its parent to draw its background for it, so if you had another control behind it, it wouldn't show through.
Infact, it may only get the background colour of the parent and use that... i'm not entirly sure.
My current favourite word is: PIE!
I have changed my name to my regular internet alias. But don't let the 'Genius' part fool you, you don't know what 'SK' stands for.
-The Undefeated
|
|
|
|
|
Anyway... i think you will have to draw it yourself, which is quite simple really. But if you do end up drawing it yourself, it may be easier to just have a panel and use the OnPaint event for that, rather than using a picture box.
My current favourite word is: PIE!
I have changed my name to my regular internet alias. But don't let the 'Genius' part fool you, you don't know what 'SK' stands for.
-The Undefeated
|
|
|
|
|
You need to have an alpha channel in the image. I don't GIF files have it, but PNG files do.
Unfortunately the transparency only goes to the form, any controls underneath the picturebox will not be visible.
Mike
|
|
|
|
|
I have a thread which is called when a user is typing,
But if you type really fast (key smash style) it will crash becuase the datareader is already opened.
I dont actually have a declared datareader but i assume that the data adapter does that himself so i can preclose it since i cant get to its properties.
So instead i was thinking of catching the expection and rerunning the code but how do i goto the start of the thread again?
filterthread = new Thread(new ThreadStart(opg_filter_functie));
filterthread.IsBackground = true;
filterthread.Start();
private void opg_filter_functie()
{
//check if textbox isnt empty
if (opg_filterbox.Text.Length > 0)
{
try
{
opg_tv_filter.Nodes.Clear();
//sql injection causes error fix
opg_filterbox.Text = opg_filterbox.Text.Replace("'", "");
//create query
SqlDataAdapter dAdapter = new SqlDataAdapter("SELECT artiestNaam FROM artiest where artiestnaam like '" + opg_filterbox.Text + "%'" ,sqlcon);
DataSet dataset_filter = new DataSet();
dAdapter.Fill(dataset_filter); //crash here if typing to fast
|
|
|
|
|
Why not add a locker to force the method to never execute more than once at a time? All you need is a locker object:
<br />
object locker = new object();<br />
private void opg_filter_functie()<br />
{<br />
lock(locker) {<br />
if (opg_filterbox.Text.Length > 0)<br />
{<br />
try<br />
{<br />
opg_tv_filter.Nodes.Clear();<br />
opg_filterbox.Text = opg_filterbox.Text.Replace("'", "");<br />
<br />
SqlDataAdapter dAdapter = new SqlDataAdapter("SELECT artiestNaam FROM artiest where artiestnaam like '" + opg_filterbox.Text + "%'" ,sqlcon);<br />
DataSet dataset_filter = new DataSet();<br />
<br />
<br />
dAdapter.Fill(dataset_filter);
}
Standards are great! Everybody should have one!
|
|
|
|
|
Hai how can we write the generic list to excel file using C# can any one help in this
|
|
|
|
|
Well, that the data is in a list, is totally irrelevant. You can write a cvs, which excel can open, or you can control Office via the tools for office, and make it create an Excel file for you
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
hi
I have a C# app that embeds another app inside of it using setparent win32 API however the embedded application launches other Child applications that check if the parent is running by using FindWindow with a Class name of “MyWndClass”.
The solution would seem to be to set the Class name of my app to “MyWndClass” but I can only find reference on how to do this using C++ using PreCreateWindow().
So how can I do this from C#?
|
|
|
|
|
I have a MenuStrip with a number of ToolStripMenuItems
I'm trying to show a context menu when they are right-clicked so on the MouseUp-event I add
private void presetItem_MouseUp(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Right)
{
presetMenu.Show(Cursor.Position);
}
}
This works but the menu I right-clicked closes when the context-menu shows up.
Can I prevent the menu from closing somehow?
|
|
|
|
|
That's default behavior.
i think you need to make your own control that derives from ToolStrimMenuItem and in that override accordingly
|
|
|
|
|
Ok, Thanks... I will try and come with something
|
|
|
|
|
How to generate excel sheet in aspx page in c#.Net
suman.C
|
|
|
|