|
cho mình hỏi muốn tạo cái Save As trong notepad++ phai lam sao vậy
|
|
|
|
|
ku_do_thien wrote: cho mình hỏi muốn tạo cái Save As trong notepad++ phai lam sao vậy
I don't understand, which language is this?!
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
www.aktualiteti.com
|
|
|
|
|
This what Google translator gave me :
ask yourself what you want to create Save As tron notepad++ fade lam sao so.
Its in Vietnamese BTW.
People with high attitude deserve the standing ovation of our highest finger!
My Blog![ ^]
|
|
|
|
|
In Listbox, i need only the alphabetics characters as their names
while editing or adding new items to the List box it should only accept the Alphabets.
can any one please help me in this code using C#
please help me
|
|
|
|
|
You need to check each char of the new entry like this
private static bool CheckEntry(string newEntry)
{
char[] newEntryChars = newEntry.ToCharArray();
foreach (char ch in newEntryChars)
{
if (!Char.IsLetter(ch))
return false;
}
return true;
}
Hope this helps
...and I have extensive experience writing computer code, including OIC, BTW, BRB, IMHO, LMAO, ROFL, TTYL.....
|
|
|
|
|
If you are adding the items to the ListBox using a TextBox, then you can use this to prevent characters other than alphabets to enter in your textbox like this :
void textBox1_KeyPress(object sender, KeyPressEventArgs e)
{
Char key = e.KeyChar;
if (Char.IsLetter(key))
{
e.Handled = false;
}
else
{
e.Handled = true;
}
}
People with high attitude deserve the standing ovation of our highest finger!
My Blog![ ^]
|
|
|
|
|
Except if he right clicks and selects "Paste", of course...
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
Manfred R. Bihy: "Looks as if OP is learning resistant."
|
|
|
|
|
Woops didn't think about it.
People with high attitude deserve the standing ovation of our highest finger!
My Blog![ ^]
|
|
|
|
|
I did something similar (in reverse, numerics only) for a textbox some time ago that handles all use cases - you could tweak the logic for your control to allow only the characters you want. Clickety[^].
|
|
|
|
|
when a control is added to the panel i need to store some details about that control ,for that i tried to use the way of
"panel.Control.add()" but i can't override the add method of the controlcollection of the panel. i'm using c# 3.5 CF.
So is there any way of achieving this , appreciate your ideas,
thanx in advance .
|
|
|
|
|
.NET offers this event[^]. If that isn't available on CF, your best bet might be to provide an AddControl() method which does whatever you want it to do; the disadvantages would be: Controls.Add() remains available, and Visual Designer would not call your method.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
I am using two list boxes and some buttons...
i am trying to shift the items from list 1 to list 2, vice - versa.
while i try to attempt to move names from from one list to another it should accept the same names(i.e, duplicate names should not be accepted)
can any one please help me...
|
|
|
|
|
You just need to check whether the name you are trying to move exists in the ListBox you are trying to move it to. I would keep 2 List<item> 's in memory and bind these to the ListBoxes and Add or Remove from the List<item> and rebind as necessary.
...and I have extensive experience writing computer code, including OIC, BTW, BRB, IMHO, LMAO, ROFL, TTYL.....
|
|
|
|
|
if (!list2.Contains(list1.selectedName))
{
list2.Add(selectedName);
}
- Regards - J O N
A good thing is a bad thing if it keeps you from the best thing. - Dr. Adrian Rogers
|
|
|
|
|
|
The previous solution can be slow if the lists are long. Inserting the names into a hash table will eliminate duplicates and run much faster if there are many names.
|
|
|
|
|
|
I have been trying to write the clipboard content to an external windows application (currently running process) from a C#(WPF) application using SendMessage API and WM_PASTE . Can't get it work. Here is the sample code
public const int WM_PASTE = 0x0302;
[DllImport("User32.dll")]
public static extern Int32 FindWindow(String lpClassName,String lpWindowName);
[DllImport("user32.dll", CharSet=CharSet.Auto)]
public static extern int SendMessage(int hWnd, int msg, int wParam, IntPtr lParam);
private void btn_Click(object sender, System.EventArgs e)
{
int hwnd=0;
hwnd = FindWindow(null, "Untitled - Notepad");
if (hwnd != 0)
{
Clipboard.SetText("sample text from clipboard");
hwnd = FindWindow(null, "Untitled - Notepad");
SendMessage(hwnd, WM_PASTE, 0, IntPtr.Zero);
}
}
Note: have to Notepad app opened to test the code
tried some other possible combinations
SendMessage, WM_PASTE<br />
SendMessage, WM_CHAR<br />
PostMessage, WM_PASTE<br />
PostMessage, WM_CHAR
An alternate way to send keystrokes to an extern app using SendMessage and PostMessage
SendMessage, (WM_KEYDOWN, WM_KEYUP) For CTRL+V<br />
PostMessage, (WM_KEYDOWN, WM_KEYUP) For CTRL+V
Windows.System.Forms.SendKeys.SendWait("^V") -> works but not always
any idea?
- Regards - J O N
A good thing is a bad thing if it keeps you from the best thing. - Dr. Adrian Rogers
modified on Wednesday, April 20, 2011 6:17 AM
|
|
|
|
|
alright, getting the child window of the notepad application works which is the edit control.
we can do a PASTE only in the edit panel of the notepad application. modified code below...
GetWindow_Cmd.GW_CHILD = 5
int hwnd=0;
int hwndChild=0;
hwnd = FindWindow(null, "Untitled - Notepad");
if (hwnd != 0)
{
Clipboard.SetText("sample text from clipboard");
hwnd = FindWindow(null, "Untitled - Notepad");
hwndChild = GetWindow(hwnd, GetWindow_Cmd.GW_CHILD);
SendMessage(hwndChild , WM_PASTE, 0, IntPtr.Zero);
}
now, how do i find the window handle of the static edit control of "winword" and "mspaint" application
same approach doesn't work...
any idea?
- Regards - J O N
A good thing is a bad thing if it keeps you from the best thing. - Dr. Adrian Rogers
|
|
|
|
|
-
ok, i think, using WM_PASTE to paste the contents into word or paint is somewhat complex.
not able to find a way to get the handle of the edit panel.
a simple solution is adopted and it works
Win32.SendMessage(hWnd, Win32.WM_SYSCOMMAND, (IntPtr)Win32.SC_RESTORE, IntPtr.Zero);
Win32.SetForegroundWindow(hWnd);
System.Threading.Thread.Sleep(100);
System.Windows.Forms.SendKeys.SendWait("^v");
- Regards - J O N
A good thing is a bad thing if it keeps you from the best thing. - Dr. Adrian Rogers
|
|
|
|
|
I'm a student and I'm doing my thesis. I'm using ACOS3 1.07.18, according to it's manual book, the 18 is mean that the card can contain 24KB of data. I want to ask you how to use all of that 24KB?
I have formatted it, first I'm trying to format it using 94 files, but I got a problem in record number 31 (record number starts from 0), the card return code that the address could not be found. I read the manual once more, I found that in the personalizetion stage I only can make 31 files.
I formatted the card using 31 files (record number 0 - 30) with 254 Bytes record length in each. That's mean I only can use 31 x 254 Bytes = 7.874 Bytes.
Please help me what should I do to use that 24 KB?
Thanks before.
modified on Wednesday, April 20, 2011 3:22 AM
|
|
|
|
|
Firstly: Never post your email address in any forum, unless you really like spam! If anyone replies to you, you will receive an email to let you know. Edit your message and remove it.
Secondly: What does this have to do with C#? AFAIK, neither .NET nor Mono run on smart cards...
Contact the manufacturers - their technical support should be able to help you!
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
Manfred R. Bihy: "Looks as if OP is learning resistant."
|
|
|
|
|
OK, I'm sorry for that mistake and thanks to OriginalGriff for replying my post. I mean, my programming language is C#, and I have to write some data to the smart card. But I have a problem with the smart card as I wrote before. I hope someone who have ever used a smart card could help me.
|
|
|
|
|
It's cool!
I would strongly suggest that the manufacturers will have a better idea than anyone here: it may be a feature specific to that smart card, and no other.
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
Manfred R. Bihy: "Looks as if OP is learning resistant."
|
|
|
|
|
Yes I hope so, they haven't reply my message yet. I'm confuse, so I try to post here, who knows someone in here can help me.
Thanks for your suggestion...
|
|
|
|