I want only created by user to edit the form and readonly for all other users.
I tried Current User==Created By didnt work
Then I tried to put a single line text box to get the value of created by field which displayed Null, however, in the other single line text field the current user value is displayed like i:0#.w|domain\username that too only in create new item mode but not in Edit mode.
The created By value is not displayed all times (new, edit or display).
text box's default value is only populated in NEW form. therefore you do not see it in other cases.
you have to compare named control on the form to the CurrentUser reference, comparison to list field (item property) do not work OOTB.
since 'Created By' list field can not be placed on the form, you will have to create and maintain your list field for Author.
to compare Author to current user use formula
Obaida Aqel, I'd recommend to create brand new question and describe into very details your setup and problem(s).
without knowing that it's to hard to provide any sensefull answer to your "Can't find" and "not working also" claims.
You need to create a people field with select Account and then update that field with which ever user you like and compare panel / control with that field that is the best possible solution.
It worked for me all the time.