Oops sorry I thought I have sent my last updated reply. Well, I figured out what I want to do shortly after I post my last message, I was suppose to send new message but I guess it had an error didnt send it. Now, I have an edit box(IDC_E1) that could only accept 5 chars. I also had a button(IDC_B1) that pass character 'a' on my edit box. The problem is when I use my IDC_B1 and click them more than 5 times, my IDC_E1 can exceed more than 5 characters. What I want is to limit my IDC_E1 to 5 characters whether I type to it, or use my IDC_B1.Anyway, what I did is I just manually check the length of the edit box. Is there a better way to do it? Thanks again for the reply.