Click here to Skip to main content
15,917,709 members
Home / Discussions / C#
   

C#

 
GeneralRe: fill web form using a windows form written in c# Pin
cemlouis17-Sep-04 23:53
cemlouis17-Sep-04 23:53 
GeneralRe: fill web form using a windows form written in c# Pin
sreejith ss nair17-Sep-04 23:58
sreejith ss nair17-Sep-04 23:58 
GeneralRe: fill web form using a windows form written in c# Pin
cemlouis18-Sep-04 5:29
cemlouis18-Sep-04 5:29 
GeneralCreating Access database in runtime Pin
janigorse17-Sep-04 22:36
janigorse17-Sep-04 22:36 
GeneralRe: Creating Access database in runtime Pin
Vasudevan Deepak Kumar18-Sep-04 1:53
Vasudevan Deepak Kumar18-Sep-04 1:53 
GeneralUsing Web Services from Java Pin
sacoskun17-Sep-04 22:22
sacoskun17-Sep-04 22:22 
QuestionHow to make line limit to input string in Textbox control. Pin
Anonymous17-Sep-04 13:48
Anonymous17-Sep-04 13:48 
AnswerRe: How to make line limit to input string in Textbox control. Pin
Jay Shankar17-Sep-04 17:06
Jay Shankar17-Sep-04 17:06 
You can get the total lines the Textbox has, by P/Invoking SendMessage with EM_GETLINECOUNT.
If total lines exceeds MaxLines(2 in your case), you do not allow any thing to be written in the TextBox

Below code will help you to achieve the same.


public const int EM_GETLINECOUNT = 0xBA;

[System.Runtime.InteropServices.DllImport("user32.dll")]
public static extern Int32 SendMessage (Int32 hWnd, Int32 wMsg , Int32 wParam , Int32 lParam );



public static int GetTotalLines(TextBox tb)
{
	int totalLines = 0;
	totalLines = SendMessage(tb.Handle.ToInt32(), EM_GETLINECOUNT, 0, 0) + 1;
	return totalLines;
}

GeneralRe: How to make line limit to input string in Textbox control. Pin
sacoskun17-Sep-04 22:25
sacoskun17-Sep-04 22:25 
GeneralRe: How to make line limit to input string in Textbox control. Pin
Jay Shankar18-Sep-04 0:00
Jay Shankar18-Sep-04 0:00 
GeneralRe: How to make line limit to input string in Textbox control. Pin
Anonymous18-Sep-04 8:00
Anonymous18-Sep-04 8:00 
Questionhow to read utf8 string from mysql and save to a xml file? Pin
niqing17-Sep-04 12:42
niqing17-Sep-04 12:42 
GeneralDataGrid Pin
ImanMahmoud17-Sep-04 10:01
ImanMahmoud17-Sep-04 10:01 
GeneralRe: DataGrid Pin
Heath Stewart17-Sep-04 10:46
protectorHeath Stewart17-Sep-04 10:46 
GeneralRe: DataGrid Pin
ImanMahmoud17-Sep-04 11:45
ImanMahmoud17-Sep-04 11:45 
GeneralRe: DataGrid Pin
sreejith ss nair17-Sep-04 23:39
sreejith ss nair17-Sep-04 23:39 
QuestionHow to specify the default Toolbox Tab for a custom control Pin
shark9265117-Sep-04 9:51
shark9265117-Sep-04 9:51 
AnswerRe: How to specify the default Toolbox Tab for a custom control Pin
Heath Stewart17-Sep-04 10:42
protectorHeath Stewart17-Sep-04 10:42 
GeneralEasiest way to load this Pin
Joel Holdsworth17-Sep-04 9:44
Joel Holdsworth17-Sep-04 9:44 
GeneralRe: Easiest way to load this Pin
Heath Stewart17-Sep-04 10:28
protectorHeath Stewart17-Sep-04 10:28 
GeneralAdding control to a form delets the custom control from the form Pin
SandeepN17-Sep-04 6:47
SandeepN17-Sep-04 6:47 
GeneralRe: Adding control to a form delets the custom control from the form Pin
Jay Shankar17-Sep-04 15:57
Jay Shankar17-Sep-04 15:57 
GeneralRe: Adding control to a form delets the custom control from the form Pin
Jay Shankar17-Sep-04 16:03
Jay Shankar17-Sep-04 16:03 
Generalprotect my picture Pin
oOomen17-Sep-04 6:39
oOomen17-Sep-04 6:39 
GeneralRe: protect my picture Pin
Heath Stewart17-Sep-04 7:00
protectorHeath Stewart17-Sep-04 7:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.