|
is it possible to get a "text" in a listbox from a mouse point.. im trying to make it so when the user hovers the mouse over a item in the list box that item becomes selected. Is it possible to do this ?
Thanks Alot.
Jesse M
The Code Project Is Your Friend...
|
|
|
|
|
jtmtv18 wrote:
is it possible to get a "text" in a listbox from a mouse point.. im trying to make it so when the user hovers the mouse over a item in the list box that item becomes selected. Is it possible to do this ?
public class ListBoxEx : ListBox
{
protected override void OnMouseHover(EventArgs e)
{
SelectedIndex = IndexFromPoint(PointToClient(MousePosition));
base.OnMouseHover(e);
}
}
That should do it
MyDUMeter: a .NET DUMeter clone "Thats like saying "hahahaha he doesnt know the difference between a cyberneticradioactivenuclothermolopticdimswitch and a biocontainingspherogramotron", but with words you have really never heard of."
|
|
|
|
|
thanks alot leppy... i needed to do a lil work to get it to work...but the direction you gave was Dead On...thanks alot.
Jesse M
The Code Project Is Your Friend...
|
|
|
|
|
Hi, all!
Would you like to help me, plz?
Have the folow:
I want to create COM+ component with help c#, so, it will use the external(usual) dll-file(my.dll), where contents some logic (com-objects).
This dll good work in usual application, when add it as reference - all ok.
(a have not source for this dll file)
But when i try to link up it in my developed com+ app., - got folow answer from compiler:
"Assembly generation failed -- Referenced assembly 'name of my.dll' does not have a strong name"
is it have not 'strong name'????
i try the next:
al /out:my.dll "?" /keyfile:my_dll.snk
but it don't want to work... i do not understand want is this "?"
and is it right way to solve this problem? and what i must do in this case?
in any case thx.
|
|
|
|
|
Can someone point me in the right direction in creating translucent MenuItems?
I'd rather not get into a debate about why its not advisable, suffice it to say I have a unique tool that really would benefit from it.
I have tried creating a class that derives from MenuItem and overriding OnDrawItem, and then using the Handle to call several Win32 functions that set the window layered property and alpha, but it doesn't seem to work.
I admit I'm a bit lost because I'm not very familiar with Windows Forms.
Thanks so much,
Mattingly
|
|
|
|
|
Ok, I have created a form with nothing on it but a tab page with a single tab, that is marked to anchor to all sides ("top/left/right/bottom"). I then run the app, and size it back and forth, noticing a huge amount of flicker on the label for the single tab page. Additionally, anything I put on the tab page that sizes with it (ie, a Web browser control, a Rich edit box, etc) all flicker terribly as well when sizing.
I've seen other apps that manage to size tab controls without excessive flicker, what do I need to do to eliminate this flicker under C#/.net?
Thanks,
Saren
|
|
|
|
|
SetStyle(ControlStyles.DoubleBuffer, true);
SetStyle(ControlStyles.AllPaintingInWmPaint, true);
in your contructor mite help, also try not to invalidate the form too much.
MyDUMeter: a .NET DUMeter clone "Thats like saying "hahahaha he doesnt know the difference between a cyberneticradioactivenuclothermolopticdimswitch and a biocontainingspherogramotron", but with words you have really never heard of."
|
|
|
|
|
I've tried that and it doesn't seem to make any difference. How would I avoid invalidating the form? Thus far this is just a single control on a form without any additional code.
|
|
|
|
|
I would appreciate to let me know how I can pause the application run for some time (For example 1 second).
Regards,
Sassan Komeili Zadeh
|
|
|
|
|
Sassan Komeili Zadeh wrote:
I would appreciate to let me know how I can pause the application run for some time (For example 1 second).
using System.Threading;
<font color="green">
Thread.Sleep(1000);
Nick Parker
The only man who never makes a mistake is the man who never does anything. - Theodore Roosevelt
|
|
|
|
|
|
I though I was way past this when I went to program it, but once again C# stumps me and my old C programming habbits...
OK, so I have this stupid little win app I made in vs.net and it has a text box and another text box. You put your first and last name into those text boxes and then you push the 'generate' button of the form. Then the first and second text box's info are put togeather and the person's full name is printed out to the third text box. It's that simple... but rather then elaborating anymore on what went wrong can somebody just give me the code??? I think it would be alot easier, thanks.
-.a.e.
P.S. All I need is all the stuff after the "[STAThread]" thingy.
/\ |_ E X E GG
|
|
|
|
|
Man, somebody should help that kid out... He's dumb...
/\ |_ E X E GG
|
|
|
|
|
eggie5 wrote:
P.S. All I need is all the stuff after the "[STAThread]" thingy.
Um, double click on your button once you have all your textboxes on your form, add the following (or something like it)
private void button1_Click(object sender, System.EventArgs e)
{
this.textBox3.Text = this.textBox1.Text.ToString() + " " + this.textBox2.Text.ToString();
}
Nick Parker
The only man who never makes a mistake is the man who never does anything. - Theodore Roosevelt
|
|
|
|
|
Ohhhh, it works now.... Thanks alot I didn't know about the 'this' thing you put on it... well it worked so who cares....
/\ |_ E X E GG
|
|
|
|
|
You actually don't need to use the "this" keyword when you are dealing with members of the class you're in. They're just there so that when you hit the period, the dropdown list kicks in and offers you a list of members.
Hey, what can I say? I'm a chick magnet...a babe conductor...a logarithm for the ladies.
-Strong Bad from HomeStarRunner.com
Essential Tips for Web Developers
|
|
|
|
|
David Stone wrote:
They're just there so that when you hit the period, the dropdown list kicks in and offers you a list of members.
I used to do that till I realized Alt-Right Arrow does the same.
MyDUMeter: a .NET DUMeter clone "Thats like saying "hahahaha he doesnt know the difference between a cyberneticradioactivenuclothermolopticdimswitch and a biocontainingspherogramotron", but with words you have really never heard of."
|
|
|
|
|
David Stone wrote:
They're just there so that when you hit the period, the dropdown list kicks in and offers you a list of members.
David there is actually a little history regarding the "this" pointer, this was the best I could do on short notice:
The this Pointer[^]
The this Pointer[^]
Nick Parker
The only man who never makes a mistake is the man who never does anything. - Theodore Roosevelt
|
|
|
|
|
Sweetie,
You don't need to call .ToString() on a Text Property..LOL.
Amber Star
|
|
|
|
|
amberstar wrote:
Amber Star
Who is that a picture of that you have on your profile?
Nick Parker
The only man who never makes a mistake is the man who never does anything. - Theodore Roosevelt
|
|
|
|
|
Hi,
I've used from OleDbDataAdapter and DataSet to work by database (MS Access).
Sometimes I get following exception : " The OleDbCommand is currently busy Open, Executing. "
Can anyone say me, why this exception occurred?
Mehdi
|
|
|
|
|
how can i disable the form's movement and response to a mouse click ?
Jesse M
The Code Project Is Your Friend...
|
|
|
|
|
|
I ask a question about PropertyGrid control in C#.
How can I add new PropertyTab into PropertyGrid control?
I write a class inherited from System.Windows.Form.Design.PropertyTab, but it cannot work, I donnt know what is the problem? When I start the Form, the PropertyGrid control can show properly, but there is no new PropertyTab added in. Who knows the answer?
thanks in advance.
Tony L
email: z2629@263.net
I like C#.
|
|
|
|
|
nobody knows the answer?
I like C#.
|
|
|
|