|
I plan to create a custom textbox class that when user press the enter key it will focus to another control. But i would like to check out that, should i place the GetNextControl method in the textbox class or in the base form class ? I found that code below not working ..
<br />
public class baseTextBox:System.Windows.Forms.TextBox <br />
{<br />
protected override void OnKeyDown(KeyEventArgs e)<br />
{<br />
if (e.KeyCode == Keys.Enter) <br />
{<br />
Control ctrl = this.GetNextControl(this,true);<br />
ctrl.Focus();<br />
e.Handled = true;<br />
}<br />
}<br />
}<br />
Please advice. Thanks.
|
|
|
|
|
|
Thanks for help.
So i should put the code in a base form class instead of inside the textbox base class right ? Instead of using "this" so what should i use ?
|
|
|
|
|
hi dears,I have created asp.net proeject.i am facing a problem.
I have applied paging on datagrid.I have set page size to 10 record per page.I want to show "ext"on the Left of my Grid and "rev"on the Right of my Grid.Is it possible to do in grid.Give ur comment at my Email address
rahimali_imt@hotmail.com
Thank in Advance
|
|
|
|
|
|
no text
---
b { font-weight: normal; }
|
|
|
|
|
if anyone knows anything about c++ and mysql please try to help me, and go
to:
http://www.codeproject.com/script/comments/forums.asp?forumid=1647&select=1153332
.
there you can find a big problem i have.
please help me sigh: sigh: sigh:
|
|
|
|
|
Hello members,
I need help regarding the above mention topic i.e,serial and parallel port programming in C# or serial to parallel data conversion in C#.
Its urgent.I'll be very thankful for your help.
Nadia Mughal
|
|
|
|
|
I want to call an Event when user press Enter.For example i have two text box.one for username and other is password.i want when my user type user name and password and press enter,i want signin Event to Fire.My code is working when the user press click on sign in button.I want my code to be execute when the user press Enter after typing UserName and password.Plz hepl me dear.Send ur comment at hotmail id
rahimali_imt@hotmail.com
thank in Advance
|
|
|
|
|
Set the form's Accept button property to the "sign in" button. That should do the trick.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Thank for response me.
Actually i have make User Control for the sign in Here, i did not find any property forms Accept Button.Now tell me what to do.Thank in advance
|
|
|
|
|
How to ask questions[^]
Please pay particular attention to the section entitled "Use meaningful, specific subject headers" in addition to why people do not answer public message using private email addresses.
|
|
|
|
|
I want to use Bitmap in one dll. But I can't use System.Drawing in the dll.
Help me please!
|
|
|
|
|
Add a reference to the System.Drawing assembly in your visual studio .NET project.
WM.
What about weapons of mass-construction?
|
|
|
|
|
My problem :
I use a notify icon on a form .. and I want to only show the notify icon and not the form ... but I didn't have any success cause the form tries to open as visible
The only solutions I came up with are
1.to start a timer on form load
2.override the OnVisibleChange method and set visibble always to false
I think the cause for the error is Application.Run( myform ) or probably an error with .NET Framework wich I doubt
Is anybody else experiencing this or I 'm the only one who gets this king of errors .
I tried to set visible false in the constructor but it still shows the form ..
This error comes up in .Net 1.1 , 2.0 Beta2 , haven't tried it on 1.0.. but i'm pretty sure it's the same
If you want to see that I'm write ... create a new C# project ... and in the form constructor write
,.....
this.Visible = false
......
Ok... if someone can tell me why ... or if they have a more viable solution I'll whait for it
Lazar Mihai
Highschool student
|
|
|
|
|
have you tried this.Opacity = 0;
|
|
|
|
|
Unfortunatly this only works in win2k/xp/2k3
WM.
What about weapons of mass-construction?
|
|
|
|
|
Quite right you are. What about setting the size of the form to zero and the borderstyle to none then?
form.Size = new Size(0,0);
form.FormBorderStyle = FormBorderStyle.None;
|
|
|
|
|
I have XP ... there is where it doesn't work ...
Lazar Mihai
Highschool student
|
|
|
|
|
Override the form's OnLoad and set the forms Visible property to false in there.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Overriding doesn't work ... I 've tried it ... it was probably the first thing I tried ...
Lazar Mihai
Highschool student
|
|
|
|
|
U can use this code (with P/Invoke implemenstation):
.....<br />
using System.Runtime.InteropServices;<br />
.....<br />
public class Form1 : System.Windows.Forms.Form<br />
{<br />
....<br />
protected override void OnLoad(System.EventArgs e)<br />
{<br />
WIN32 win32 = new WIN32();<br />
win32.HideWindow(this.Handle);<br />
}<br />
...<br />
}<br />
<br />
<br />
public class WIN32<br />
{<br />
public WIN32()<br />
{<br />
}<br />
<br />
public void HideWindow(System.IntPtr handle)<br />
{<br />
ShowWindow(handle,WindowShowStyle.Hide);<br />
}<br />
<br />
[DllImport("user32.dll")]<br />
private static extern bool ShowWindow(IntPtr hWnd, WindowShowStyle nCmdShow);<br />
<br />
private enum WindowShowStyle : uint<br />
{<br />
Hide = 0,<br />
ShowNormal = 1,<br />
ShowMinimized = 2,<br />
ShowMaximized = 3,<br />
Maximize = 3,<br />
ShowNormalNoActivate = 4,<br />
Show = 5,<br />
Minimize = 6,<br />
ShowMinNoActivate = 7,<br />
ShowNoActivate = 8,<br />
Restore = 9,<br />
ShowDefault = 10,<br />
ForceMinimized = 11<br />
}<br />
}
It will your main window...
|
|
|
|
|
Leave out "myform" when you call Application.Run.
ie: Application.Run();
-Chris
|
|
|
|
|
how can i display the datagrid row items in to textboxes when double clicked on that row. i'm using Visual studio.net 2003, and working on CSharp (C#). can anyone help me with code or an application???
thanks, horussssssssssssssssssssss
hello
|
|
|
|
|
First you need to implement an eventhandler for the mouseup event of the datagrid. The following code can be inserted there:
BindingManagerBase bmb = dataGrid.BindingContext[dataGrid.DataSource,dataGrid.DataMember];
DataGrid.HitTestInfo hti = dataGrid.HitTest(e.X,e.Y);
if(e.Button == MouseButtons.Left) {
if(hti.Type == DataGrid.HitTestType.Cell || hti.Type == DataGrid.HitTestType.RowHeader) {
bmb.Position = hti.Row;
dataView1.RowFilter = string.Format("Id = '{0}'",(bmb.Current as DataRowView)["Id"]);
}
}
You can then bind the textboxes to a dataview that has the same table as the datagrid.
WM.
What about weapons of mass-construction?
|
|
|
|