Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


[Help: C++] Last Questions

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
lurc
Grandmaster Cheater Supreme
Reputation: 2

Joined: 13 Nov 2006
Posts: 1900

PostPosted: Wed Aug 22, 2007 9:08 am    Post subject: [Help: C++] Last Questions Reply with quote

these are my last questions for now. then i wont ask questions for a while

i wanna make sur e that a textBox has:

1. Only Numbers
2. It is not Empty (ive tried some stuff like textBox1->Text->IsNullOrEmpty, but i dont know how to use it properly)

Example Code would be nice, thanks

_________________
Back to top
View user's profile Send private message
DeletedUser14087
I post too much
Reputation: 2

Joined: 21 Jun 2006
Posts: 3069

PostPosted: Wed Aug 22, 2007 10:20 am    Post subject: Reply with quote

I can tell you in Delphi.

If Edit1.Text = '' then //if the box is empty then
{Your code here} //your request here

What are you trying to do ?
Back to top
View user's profile Send private message
merkark12
Advanced Cheater
Reputation: 0

Joined: 04 Jul 2007
Posts: 74
Location: In that program you just downloaded

PostPosted: Wed Aug 22, 2007 10:22 am    Post subject: Reply with quote

do you mean .net?
_________________


Back to top
View user's profile Send private message
assaf84
Expert Cheater
Reputation: 0

Joined: 03 Oct 2006
Posts: 238

PostPosted: Wed Aug 22, 2007 10:27 am    Post subject: Reply with quote

In C++ you can put an atoi() in a try-catch structure, or loop all the chars and check if they are numbers.
Back to top
View user's profile Send private message
lurc
Grandmaster Cheater Supreme
Reputation: 2

Joined: 13 Nov 2006
Posts: 1900

PostPosted: Wed Aug 22, 2007 4:16 pm    Post subject: Reply with quote

um.. any simpler? cuz i dont wanna make a huge code.... im sure there r functions...

textBox1->Text->IsNullOrEmpty
textBox1->Text->Length

those 2 seem ez, just is there a special way to use them?

_________________
Back to top
View user's profile Send private message
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Wed Aug 22, 2007 6:17 pm    Post subject: Re: [Help: C++] Last Questions Reply with quote

lurc wrote:
these are my last questions for now. then i wont ask questions for a while

i wanna make sur e that a textBox has:

1. Only Numbers
2. It is not Empty (ive tried some stuff like textBox1->Text->IsNullOrEmpty, but i dont know how to use it properly)

Example Code would be nice, thanks


Use a MaskedTextBox control. You can set it to only accept numeric.
Back to top
View user's profile Send private message
lurc
Grandmaster Cheater Supreme
Reputation: 2

Joined: 13 Nov 2006
Posts: 1900

PostPosted: Wed Aug 22, 2007 8:11 pm    Post subject: Reply with quote

that solves 1 thing. but i still have to make it check if its empty

also i dont like how the RichEditBox works.. it masks a bunch of 0's with spaces but u can click anywhere in between unlike a normal text box , it just starts at the beggining

_________________
Back to top
View user's profile Send private message
TheSorc3r3r
I post too much
Reputation: 0

Joined: 06 Sep 2006
Posts: 2404

PostPosted: Thu Aug 23, 2007 7:29 am    Post subject: Reply with quote

Code:
char buffer[256];
if (!GetWindowText(hTextBox, buffer, 256)) MessageBox(0, "phail", "empty", 0);

_________________


Don't laugh, I'm still learning photoshop!
Back to top
View user's profile Send private message
Icos
Grandmaster Cheater
Reputation: 0

Joined: 12 May 2007
Posts: 524

PostPosted: Thu Aug 23, 2007 8:44 am    Post subject: Reply with quote

Are you talking about Win32 C++? You can add ES_NUMBER attribute while using CreateWindow to force it to accept numbers only.
Back to top
View user's profile Send private message
lurc
Grandmaster Cheater Supreme
Reputation: 2

Joined: 13 Nov 2006
Posts: 1900

PostPosted: Thu Aug 23, 2007 9:23 am    Post subject: Reply with quote

Managed C++

Edit:

Nvm, i figured it out.

i was putingg this line at the bottom as "else if" instead of putting it at the top as "if"

Code:
textBox1->Text->IsNullOrEmpty(textBox1->Text)

_________________
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites