|
You can assign your own ContextMenu to a TextBox and do whatever you want in there.
mav
|
|
|
|
|
You have not understand my question: i explain it better.
That textbox is not inside my application but it could be a inputbox (textbox) of Internet Explorer or of Photoshop or whatever other application.
|
|
|
|
|
What you're trying to do is integrate your app with the Windows Shell. Search codeproject articles or your favorite search engine for "Windows Shell integration" and you should get some helpful hits.
Tech, life, family, faith: Give me a visit.
Judah Himango
|
|
|
|
|
Hello,
May be it is very very simple but I could not find the solution.
In a datagrid, I would like to pass the next cell by passing ENTER key..How can I do this.Please help..When I use the tab key I got very stupid results.
|
|
|
|
|
you could intercet the ENTER key pressing, then simply tell datagrid to select the cell you want, in your case try to use something as .SelectedIndex = .SelectedIndex + 1;
|
|
|
|
|
Thank you very much...But I it doesnt work.
When I enter in a cell then I could not see the key press event.If it possible could you please send a code sample
|
|
|
|
|
right now i'm learning about hook message...
Read this: http://www.codeproject.com/csharp/GlobalSystemHook.asp
Using the hook you can estable in whichever moment if is cliccked the Enter button.
|
|
|
|
|
Using a global system hook in this case, is like digging a small hole with a nuke
Beneath this system wide approach there are some more levels of detecting keyboard input:
1. You can install an application hook, that will catch all keyboard input of your application.
2. When you set the Form.KeyPreview property to true, the form will receive all KeyPress, KeyDown, and KeyUp events before they are assigned to the control with focus.
3. The DataGrid class provides KeyDown , KeyPress and KeyUp events which should be fired when you edit a cell.
www.troschuetz.de
|
|
|
|
|
Use the KeyPress event of your datagrid. I've never used datagrid in WinForms but I'm pretty sure it's fired when you edit a cell.
www.troschuetz.de
|
|
|
|
|
please stefan,
give me an example...How?
|
|
|
|
|
If you're using Visual Studio, select your datagrid in the Forms designer, go to the properties window, click on the yellow bolt to get a list of events provided by the datagrid and double-click on KeyDown. The designer creates an event handler, subscribes it and jumps to the event handler in the code file. If you don't use a IDE, you have to insert the following code on your own.
this.dataGrid1.KeyDown += new KeyEventHandler(this.dataGrid1_KeyDown);
private void dataGrid1_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyData == Keys.Return)
{
}
}
www.troschuetz.de
|
|
|
|
|
Stefan,
First of all I would like to say thank you for your attention.
But when I run the application navigation is not working properly.
Suppose that I am editing the first column and first row (1,1).When I press the ENTER key then cursor is navigating to first column second row(1,2)..My purpose is just navigating the next cell.
Or if I am at the last cell (n,n) then I must navigate to (n,n+1)
....
|
|
|
|
|
As I said, I've never used the WinForm datagrid, so I can't help you with this one. Only wanted to show a way of detecting the keyboard input, so you can go on with the suggestion of the first poster.
Sorry and good luck!
www.troschuetz.de
|
|
|
|
|
I have two forms Form1 and Form2.
In form1 i have a grid control and a button. On button click form2 open. In form2 i have two textboxes & a button (Insert Value). I want when i click on form1 button form2 opens and i fill all values and then i click form2 button (Insert) all values insert in grid control and form2 close.
Does any body know how to do this?
MUHAMMAD WAQAS BUTT
|
|
|
|
|
MUHAMMAD,
From memory this is not really pleasant, But you need to create a new instance of Form1 to be able to programatically controll it and its values. Because the first instance of form1 has nothing to do with form2.
If ne one has a better solution please let me know, because i dont like the work around.
Thanks
Chris
|
|
|
|
|
MUHAMMAD,
Have u thought of using TAB pages?
Chris
|
|
|
|
|
You can use any solution of the follows:
1.make all textBoxes in form2 Public (not private), and then from from1 you can access all textBoxes in form2-the OK button now is just used to close the form.
2.You can create an array(public in form2) of length=the number of textBoxes u have in form2 and the OK button fills this array then closes the form, then from form1 you can access this array.
|
|
|
|
|
I've a form 400x300.
At the start it show a panel (panel1) with its contein.
When i click on OK button it hide the first panel and shows the second one (panel2) and so on since to panel4.
Now in design mode how can i implement this functionality?
If i insert a panel and i add its contein how can i add the second one?
If i add it over the first one, how can i get access at the first one to add a new textbox for example?
|
|
|
|
|
You can programatically create and control panels on the form. Simply create and dispose of a panel once you have finished with it. Create a new panel control and assign it its dimensions and location within the form.
|
|
|
|
|
yes but new panel hide the others above, so if i need to work with the first one i can't whether i delete the others over.
|
|
|
|
|
Make a very big form so you can have all 4 panels side by side. And in the constructor resize the form to only have the first panel visible, and when you need to use another panel, move it to the position of the first panel.
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
|
|
|
|
|
I think that you misunderstood the question. I happen to have the same question. What I'm looking for is a mechanism to create panels with controls at design time and flip through them (ala wizard) at runtime. The pain about using panels by themselves is that it's very difficult to overlay them at design time as the designer wants to keep inserting the topmost panel into the panel in the next layer. It's a mess. The only solution I have found thus far is to create the panels in different locations and then create them at runtime, locating them where needed. It would be very nice to have a TabControl-like container control to assist with this. I myself would use a TabControl, but there's no current mechanism in place that I know of to remove the tabs. (.Net 2.0 - Whidbey Beta 1)
If anyone can direct me to a resource for such a control, I'd be much obliged.
Thanks,
Bob Briggs
|
|
|
|
|
u can use the Control.BringToFront() and Control.SendToBack() ,within the designer, functions to get access to any control.
Mr.Cooper
|
|
|
|
|
Hello dear All
I am surfing very big problem last few days if you have
any idea please help me. I am developing application
software. I am using a tree view control and having one
problem in tree view control when I have expand all or
some node and on that time if tree control refresh then
all expanded node are collapse. I don't want to collapse
all expanded node. How can I do impalement this
functionality or I can again expand the entire node
which has expanded last time. Please Help me.
|
|
|
|
|
I can't figurout how , treeview will Collapse if you call Refresh method. Please check whether you are using CollapseAll method somewhere after updating or refreshing the treeview control. If you can show the code block, then that will be easy for getting into solution.
Sreejith Nair
[ My Articles ]
|
|
|
|