|
How can show a contect menu by left (not right of default) click a button?
|
|
|
|
|
Handle the MouseButtonDown (or whatever the name is) event, which gives you which mouse button is pressed and the point where it was pressed. Display the menu there yourself in your MouseButtonDown handler.
|
|
|
|
|
if i give that coordinates i get the context menu in 0,0 screen coordinate not at the button relative
|
|
|
|
|
This works for me, displaying the context menu at the correct position. Note I'm using the right mouse button, but that shouldn't make any difference. I'm handling the MouseDown event of a control on the form, though.
<br />
private void datagridview_MouseDown(object sender, MouseEventArgs e)<br />
{<br />
if (e.Button == MouseButtons.Right)<br />
{<br />
.......<br />
headerContextMenuStrip.Show(dataGridView, e.X, e.Y);<br />
}<br />
}<br />
|
|
|
|
|
|
I have a program that displays data in a DataGridView in C# (but if you are only familiar with the DataGrid, please read on because any advice you have will still be applicable). The DataGridView is bound to a SQL Server table with a typed DataSet. I need to do a few things that I'm having difficulty with, and I'm hoping someone can point me in the right direction.
1) Some columns of the database table contain numbers, like 0, 1, 2, that represent things. For example, in one column, 0 and 1 in the database table should be shown as false and true in the DataGridView. In another case, a small range of numbers in the database table should be represented as a corresponding value from a list of strings. In the DataGridView, these columns are combo box columns that are NOT bound to any data source (I enumerate the possible combo box values when I create the DataGridView). Currently they contain the numbers from the database. How can I get them to contain the corresponding strings? I tried using the CellFormatting and CellParsing events, but they don't work properly due to the many DataError events caused by changing the cell values from short or int (as in the database table column) to string (as in FALSE/TRUE). Are the ValueMember and DisplayMember attributes of the column of any value to me? Do I have to create an unbound column? If so, how do I keep that column sorted as the user sorts the bound columns in the DataGridView?
2) One combo box column of the table gets its combo values loaded from the keys of another table (not bound to it, but I do it manually). But if my table has "foobar" in a column and the keys from the other table that get loaded into the combo box include "FOOBAR" (upper case), I get a data error event. Is there some way to make it case insensitive?
Thanks for any help.
-- modified at 17:24 Saturday 18th February, 2006
|
|
|
|
|
plz i want a code to make a face detection
i will be grateful if this code be in c# or matlab
and any one have this code send me it in hythem18@hotmail.com
thanks in advance
haitham
|
|
|
|
|
This is cutting edge technology. There are two choices:
1. Read the research papers and figure out how to implement the algorithms presented in a useable form.
2. Buy an off-the-shelf module that you can plug into your application.
Both options are expensive. The first is expensive in time, the second is expensive in cost.
ColinMackay.net
Scottish Developers are looking for speakers for user group sessions over the next few months. Do you want to know more?
|
|
|
|
|
the site is under construction so both options are failed
any one else can help?
haitham
|
|
|
|
|
eng:haitham wrote: the site is under construction so both options are failed
The context has been lost from that statement. What site are you talking about?
eng:haitham wrote: any one else can help?
I'd be very surprised if anyone here is expert enough to give you face recognition code in C#. As I said the technology is very new. Most of what is availalble will still be in research labs.
ColinMackay.net
Scottish Developers are looking for speakers for user group sessions over the next few months. Do you want to know more?
|
|
|
|
|
hi all !
consider this :
if (ListBox1.Items.Count > 0)<br />
{<br />
ListBox1.SetSelected(ListBox1.Items.Count-1, true);<br />
}
I want to put the current item instead of "ListBox1.Items.Count-1"
to take the current Item in ListBox1.how can it possible?
thanks for any help !
s_mostafa_h
-- modified at 14:18 Saturday 18th February, 2006
|
|
|
|
|
Your question is like "if some aliens would like to choose the current human on earth, what would he do"? Get the point? I mean get the point from the view of other forum users who do not know enough about your specific scenario?
Koushik Biswas
|
|
|
|
|
you are right , my ask is incomplete !
in my app. , I want to save my record (with a sql table ),also I use A listBox for navigate between Records :
private void PopulateListBox1()<br />
{<br />
.....<br />
try <br />
{<br />
strSQL = "SELECT name,id FROM MyTable";<br />
....<br />
while (myDataReader.Read())<br />
{<br />
objListItem = new ListItem(myDataReader["name"].ToString(),<br />
Convert.ToInt32(myDataReader["id"]));<br />
ListBox1.Items.Add(objListItem);<br />
}<br />
if (ListBox1.Items.Count > 0)<br />
{<br />
ListBox1.SetSelected(ListBox1.Items.Count-1,true);}....<br />
And in For Save I use the "PopulateListBox1() Function " :
private void UpdateInfo()<br />
{....<br />
try{<br />
strSQL ="update MyTable......";<br />
.....<br />
PopulateListBox1();<br />
....}<br />
So , when I want to save a Record , immediatly the LastRecord is selected .
(ofcourse my Record is saved).
thanks !
s_mostafa_h
-- modified at 10:41 Sunday 19th February, 2006
|
|
|
|
|
Can any one tell the process how i can get the handle to the MDI client(Not MDI Child) Window using Win32 PInvoke. Any kind of suggesion will be highly appriciated.
Thanks.
|
|
|
|
|
I was wanting to make an application that can display the graphical output of various different other applications specificly built to interact with it.
Example:
The main application is showing all the needed information on the main form... but the bottom right hand corner remains blank. The user can select a specialy created "daughter app" to run in this space by using a file open dialog box.
So if i make a clock or clandar program I want selecting this file to run the clock program excecutable BUT output the clock display inside the selected area of the main appliction.
I want to do this so i dont have to keep re-writing the main application when i change the available functionality of what can be displayed in this space.. so it might start out with only a selection of clock and calander but if I write an app to show weather reports, if your buddies are online or share prices, etc that can easily just be opened and displayed in this space.
Could any one give me a pointer on where to even get started with somthing like this?
Cheers.
|
|
|
|
|
You could try writing the clients as plugins to the main application. You could then pass a reference to that blank space (Panel) to the plugin and have the plugin draw itself.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
That is the sort of thing i was angling at, but It's not a subject i have ever encountered and could use some friendly prods as to the right subjects to google or search for here or on MSDN.
Thank you.
|
|
|
|
|
Depending on whether you want it to be interactive, you could periodically take a bmp of the "daughter app" and display it in the blank space.
|
|
|
|
|
You can't really. Not without a VERY convoluted effort using techniques reminiscent of PCAnywhere or VNC (hint, hint).
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
hi all!
this is the nature of the problem i am facing:
i imported a flash media on to a form. i need to put a picture over the flash media. the picture i created had a transparent background. but when i import it into form, it assumes the background of the form. i would want the image to keep the background transparent. how do i do that?
am i following the right approach? would it be better if i created the media with the graphics libraries in C#?
please help...fast...
|
|
|
|
|
Puddle of Blood wrote: but when i import it into form, it assumes the background of the form.
That is correct. Transparency in Windows at the present time is a fudge. Windows does not currently implement proper transparency as Windows Vista will do. The trick that the operating system uses is to ask the control's parent how it would render itself if it didn't have the control on top of it (This works most of the time, but you've found one of the instances where it doesn't). Windows then merges the parent's graphics with the rendering of the control and draws it solidly. In most circumstances the user wouldn't even know the difference. Since your picture control's parent will be the form, it is the form's background that gets rendered in the transparent area of the control.
ColinMackay.net
Scottish Developers are looking for speakers for user group sessions over the next few months. Do you want to know more?
|
|
|
|
|
hi all!
this is the nature of the problem i am facing:
i imported a flash media on to a form. i need to put a picture over the flash media. the picture i created had a transparent background. but when i import it into form, it assumes the background of the form. i would want the image to keep the background transparent. how do i do that?
am i following the right approach? would it be better if i created the media with the graphics libraries in C#?
please help...fast...
thanks
|
|
|
|
|
Hello,
Is there anybody out there who could give me a hint how i can realize async callbacks from a server application to all connected clients. I tryed several ways solutions based on the articles on this website, but they didn't work fine.
In the scope of my apllication there is the need to tell all clients that something happend. So the client connects via .NET Remoting over TCP to some implemented and marshaled well-known interface. This works pretty fine and easy. So what i need now is that the client could take some real events from the server.
So if there are any ideas and any help i would be very thankful about getting told about it.
Thanks
Frank Friebe
|
|
|
|
|
Simple events should work. Add the event to the server interface, subscribe to it from your clients and it should work. You might get some security exceptions, see this[^] post for more details.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Message Removed
modified 27-May-16 4:08am.
|
|
|
|