Click here to Skip to main content
15,923,222 members
Home / Discussions / C#
   

C#

 
GeneralRe: data connections and forms / apps Pin
Rob Philpott3-Feb-09 7:40
Rob Philpott3-Feb-09 7:40 
AnswerRe: data connections and forms / apps Pin
Le centriste3-Feb-09 5:21
Le centriste3-Feb-09 5:21 
GeneralRe: data connections and forms / apps Pin
l a u r e n3-Feb-09 5:22
l a u r e n3-Feb-09 5:22 
Questionchanging button status Pin
R.Dubé3-Feb-09 4:48
R.Dubé3-Feb-09 4:48 
AnswerRe: changing button status Pin
l a u r e n3-Feb-09 5:00
l a u r e n3-Feb-09 5:00 
GeneralRe: changing button status Pin
R.Dubé3-Feb-09 5:23
R.Dubé3-Feb-09 5:23 
GeneralRe: changing button status Pin
EliottA3-Feb-09 5:25
EliottA3-Feb-09 5:25 
AnswerRe: changing button status [modified] Pin
EliottA3-Feb-09 5:24
EliottA3-Feb-09 5:24 
Ok, you need to pick up a beginners book on C#. Firstly, Welcome to CP, check out the post at the top for some etiquette, specifically on "text speak", everyone hates it. It's the only universal truth. Now without knowing which control is what, and judging off your hungarian notation (naming variables based off their control type) I'm going to assume the following...

Firstly, that this code is executed on a button press.
Secondly str33 = sometextbox.Text which has a password in it
Thirdly, that encpassword is a plaintext password
Fourthly, that PassTextBox is a textbox
Fifthly, that Changebutton is a button that you wish to show ONLY when the password is correct
Sixthly, that open should pop up if the password is correct

Now this goes against all convention of not posting code, but this is just one that needs dire attention.

I'm going to go line by line and address some issues
if (str33 == encpassword) 
{
PassTextBox.Clear() 
should be PassTextBox.Text = "" or you can use PassTextBox.Enabled = false or PassTextBox.Visible = false, they will all do some sort of desired effect, clearing the textbox, disabling it or simply wiping it off the form
ChangeButton.Show() should be ChangeButton.Visible = !ChangeButton.Visible assuming Visibility is set to false (which I assume because you are trying to show it)

Main open = new Main();

you have initialized a form here, but you never showed it
open.Show();
is what you need
From here open.ChauffButton.Text should work, I don't really remember because I never access controls like this, consider placing this code elsewhere like on the load event of your form 'open'.


Those modifications, and you'll be off to a start.

modified on Tuesday, February 3, 2009 11:44 AM

GeneralRe: changing button status Pin
R.Dubé3-Feb-09 6:13
R.Dubé3-Feb-09 6:13 
GeneralRe: changing button status Pin
EliottA3-Feb-09 6:16
EliottA3-Feb-09 6:16 
GeneralRe: changing button status Pin
R.Dubé3-Feb-09 6:27
R.Dubé3-Feb-09 6:27 
QuestionRotate rectangle with mouse move events... Pin
priyareguri3-Feb-09 4:42
priyareguri3-Feb-09 4:42 
AnswerRe: Rotate rectangle with mouse move events... Pin
EliottA3-Feb-09 4:45
EliottA3-Feb-09 4:45 
GeneralRe: Rotate rectangle with mouse move events... Pin
priyareguri3-Feb-09 4:58
priyareguri3-Feb-09 4:58 
GeneralRe: Rotate rectangle with mouse move events... Pin
l a u r e n3-Feb-09 5:01
l a u r e n3-Feb-09 5:01 
GeneralRe: Rotate rectangle with mouse move events... Pin
musefan3-Feb-09 5:22
musefan3-Feb-09 5:22 
QuestionSmart Client Alternative Pin
MatthysDT3-Feb-09 3:30
MatthysDT3-Feb-09 3:30 
AnswerRe: Smart Client Alternative Pin
Rob Philpott3-Feb-09 4:32
Rob Philpott3-Feb-09 4:32 
QuestionHow to update database from datagridview directly? Pin
I'm a beginner3-Feb-09 2:48
I'm a beginner3-Feb-09 2:48 
AnswerRe: How to update database from datagridview directly? Pin
Ennis Ray Lynch, Jr.3-Feb-09 3:16
Ennis Ray Lynch, Jr.3-Feb-09 3:16 
GeneralRe: How to update database from datagridview directly? Pin
I'm a beginner3-Feb-09 4:25
I'm a beginner3-Feb-09 4:25 
GeneralRe: How to update database from datagridview directly? Pin
I'm a beginner3-Feb-09 5:32
I'm a beginner3-Feb-09 5:32 
Question(related to prasadbuddhika's problem) retrieving huge amount of data Pin
Yasithl3-Feb-09 2:45
Yasithl3-Feb-09 2:45 
AnswerRe: (related to prasadbuddhika's problem) retrieving huge amount of data Pin
EliottA3-Feb-09 2:59
EliottA3-Feb-09 2:59 
AnswerRe: (related to prasadbuddhika's problem) retrieving huge amount of data Pin
Ennis Ray Lynch, Jr.3-Feb-09 3:18
Ennis Ray Lynch, Jr.3-Feb-09 3:18 

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.