Login Register






Thread Rating:
  • 0 Vote(s) - 0 Average


Need some help - enabling checkboxes filter_list
Author
Message
RE: Need some help - enabling checkboxes #11
(03-17-2013, 02:04 AM)cxS Wrote:
(03-17-2013, 01:05 AM)i0xIllusi0n Wrote:
(03-17-2013, 12:57 AM)cxS Wrote: I'm confused.. So User_TextChanged() fires, but it only assigns password, username, turnon() fires, and the MessageBox shows?

And when turnon() is fired, how do you know that it is firing? I don't get it, you said MessageBox, but the MessageBox is in the catch?

This seems odd. As I said, lets see how you have everything laid out.

Quote:by the code I have in the thread, it should work, but it doesn't.

If it doesn't work then it shouldn't work. Are you mutli-threading anything?

I have enable(); in there as well, which is where the textbox is, the textbox shows, so I know it's firing, but the checkboxes don't enable.
It looks like it works, I don't see why not, but it doesn't. There's no multi-threading.

What? I know you did but I was trying to re-iterate my understanding of what was going on, so I did not mention enable() because I was explaining which methods were working.

Textbox? Now I'm even more confused. There's no Textbox in enable() :confused:... All I see is checkbox's and afbutton's, along with a messagebox.

Sorry about that, meant checkboxes, not textboxes.
[Image: BAvhP6h.png]
Code:
[5:42:25 PM] i0xillusi0n: Breshie don't bust a nut over chloe now
[5:42:31 PM] Entity: fapfapfapfapfapfapfapfapfapfap
[5:42:33 PM] Jigglypuff | SL: EWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW

Reply

RE: Need some help - enabling checkboxes #12
(03-17-2013, 02:09 AM)i0xIllusi0n Wrote:
(03-17-2013, 02:04 AM)cxS Wrote:
(03-17-2013, 01:05 AM)i0xIllusi0n Wrote:
(03-17-2013, 12:57 AM)cxS Wrote: I'm confused.. So User_TextChanged() fires, but it only assigns password, username, turnon() fires, and the MessageBox shows?

And when turnon() is fired, how do you know that it is firing? I don't get it, you said MessageBox, but the MessageBox is in the catch?

This seems odd. As I said, lets see how you have everything laid out.

Quote:by the code I have in the thread, it should work, but it doesn't.

If it doesn't work then it shouldn't work. Are you mutli-threading anything?

I have enable(); in there as well, which is where the textbox is, the textbox shows, so I know it's firing, but the checkboxes don't enable.
It looks like it works, I don't see why not, but it doesn't. There's no multi-threading.

What? I know you did but I was trying to re-iterate my understanding of what was going on, so I did not mention enable() because I was explaining which methods were working.

Textbox? Now I'm even more confused. There's no Textbox in enable() :confused:... All I see is checkbox's and afbutton's, along with a messagebox.

Sorry about that, meant checkboxes, not textboxes.

Or do you mean the MessageBox? You said the "textbox shows".

Try cleaning your solution, rebuilding it. Then try this instead:
Code:
.CheckState = CheckState.Unchecked;

Not sure why it won't work from another form, unless you're doing something odd. It works for me in my tests. How are you referencing the main form in order to change the label?
-- cxS

[ Haskell/.NET/C/C++ - Software Engineer ]

Reply

RE: Need some help - enabling checkboxes #13
(03-17-2013, 02:22 AM)cxS Wrote:
(03-17-2013, 02:09 AM)i0xIllusi0n Wrote:
(03-17-2013, 02:04 AM)cxS Wrote:
(03-17-2013, 01:05 AM)i0xIllusi0n Wrote:
(03-17-2013, 12:57 AM)cxS Wrote: I'm confused.. So User_TextChanged() fires, but it only assigns password, username, turnon() fires, and the MessageBox shows?

And when turnon() is fired, how do you know that it is firing? I don't get it, you said MessageBox, but the MessageBox is in the catch?

This seems odd. As I said, lets see how you have everything laid out.


If it doesn't work then it shouldn't work. Are you mutli-threading anything?

I have enable(); in there as well, which is where the textbox is, the textbox shows, so I know it's firing, but the checkboxes don't enable.
It looks like it works, I don't see why not, but it doesn't. There's no multi-threading.

What? I know you did but I was trying to re-iterate my understanding of what was going on, so I did not mention enable() because I was explaining which methods were working.

Textbox? Now I'm even more confused. There's no Textbox in enable() :confused:... All I see is checkbox's and afbutton's, along with a messagebox.

Sorry about that, meant checkboxes, not textboxes.

Or do you mean the MessageBox? You said the "textbox shows".

Try cleaning your solution, rebuilding it. Then try this instead:
Code:
.CheckState = CheckState.Unchecked;

Not sure why it won't work from another form, unless you're doing something odd. It works for me in my tests. How are you referencing the main form in order to change the label?

We aren't checking them, we're enabling them. And I'm not doing it from another form.

Form1 has the labels and checkboxes.
Form2 changes Form1s label text, which has an event handler, which I have set to re-enable the checkboxes and show a message box.
The message box shows, but the checkboxes aren't enabled.
[Image: BAvhP6h.png]
Code:
[5:42:25 PM] i0xillusi0n: Breshie don't bust a nut over chloe now
[5:42:31 PM] Entity: fapfapfapfapfapfapfapfapfapfap
[5:42:33 PM] Jigglypuff | SL: EWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW

Reply

RE: Need some help - enabling checkboxes #14
(03-17-2013, 02:30 AM)i0xIllusi0n Wrote: We aren't checking them, we're enabling them. And I'm not doing it from another form.

Form1 has the labels and checkboxes.
Form2 changes Form1s label text, which has an event handler, which I have set to re-enable the checkboxes and show a message box.
The message box shows, but the checkboxes aren't enabled.

I know you're not, but the event is being initially fired from an action on another form...

But you did not answer my question though and instead stuck to debating semantics with me about what you're doing. Here was my example:


In my main form:
Code:
private void afButton1_Click(object sender, EventArgs e)
{
    new Form2(this).Show();
}

private void label1_TextChanged(object sender, EventArgs e)
{
    checkBox1.Checked = true;
}

In Form2 (with overloaded constructor):
Code:
public partial class Form2 : Form
{
    public Form2() : this(null) { }

    public Form2(Form frm)
    {
        InitializeComponent();
        if (frm != null)
        {
            _frm = frm;
        }
    }

    private Form _frm;

    private void button1_Click(object sender, EventArgs e)
    {
        _frm.Controls["label1"].Text = "Something";
    }
}

This works for enabling/disabling as well. I only used Checked in my example because it is easier to retest.
-- cxS

[ Haskell/.NET/C/C++ - Software Engineer ]

Reply

RE: Need some help - enabling checkboxes #15
I have:

Code:
private void login(string username, string password)
        {
            string check = client.DownloadString("url");
            if (check == "Success!")
            {
                Form1 frm = new Form1();
                frm.Pass.Text = password;
                frm.User.Text = username;
                this.Hide();
                frm.ShowDialog();
                this.Close();
                
            }
            else if (check == "Wrong!")
            {
                MessageBox.Show("Wrong username and/or password!");
            }
            else
            {
                MessageBox.Show("An unknown error occured!");
            }
        }
[Image: BAvhP6h.png]
Code:
[5:42:25 PM] i0xillusi0n: Breshie don't bust a nut over chloe now
[5:42:31 PM] Entity: fapfapfapfapfapfapfapfapfapfap
[5:42:33 PM] Jigglypuff | SL: EWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW

Reply

RE: Need some help - enabling checkboxes #16
lol, that's never going to work... A newly instantiated Form1 is not the original Form1. If you're expecting that TextChanged event to fire here:
Code:
frm.Pass.Text = password;
frm.User.Text = username;

Which would explain why the MessageBox is showing and anything on the form isn't changing... Hence why I said earlier that you didn't provide enough information; this was the information needed.
-- cxS

[ Haskell/.NET/C/C++ - Software Engineer ]

Reply

RE: Need some help - enabling checkboxes #17
(03-17-2013, 03:02 AM)cxS Wrote: lol, that's never going to work... A newly instantiated Form1 is not the original Form1. If you're expecting that TextChanged event to fire here:
Code:
frm.Pass.Text = password;
frm.User.Text = username;

Which would explain why the MessageBox is showing and anything on the form isn't changing... Hence why I said earlier that you didn't provide enough information; this was the information needed.

Why does the messagebox show but the checkboxes don't re-enable though?
[Image: BAvhP6h.png]
Code:
[5:42:25 PM] i0xillusi0n: Breshie don't bust a nut over chloe now
[5:42:31 PM] Entity: fapfapfapfapfapfapfapfapfapfap
[5:42:33 PM] Jigglypuff | SL: EWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW

Reply

RE: Need some help - enabling checkboxes #18
(03-17-2013, 03:06 AM)i0xIllusi0n Wrote:
(03-17-2013, 03:02 AM)cxS Wrote: lol, that's never going to work... A newly instantiated Form1 is not the original Form1. If you're expecting that TextChanged event to fire here:
Code:
frm.Pass.Text = password;
frm.User.Text = username;

Which would explain why the MessageBox is showing and anything on the form isn't changing... Hence why I said earlier that you didn't provide enough information; this was the information needed.

Why does the messagebox show but the checkboxes don't re-enable though?

They do, everything you expect to happen, does happen. Just not on the form you think it should be happening to. This form that you're dealing with, just isn't being seen.
-- cxS

[ Haskell/.NET/C/C++ - Software Engineer ]

Reply

RE: Need some help - enabling checkboxes #19
(03-17-2013, 03:07 AM)cxS Wrote:
(03-17-2013, 03:06 AM)i0xIllusi0n Wrote:
(03-17-2013, 03:02 AM)cxS Wrote: lol, that's never going to work... A newly instantiated Form1 is not the original Form1. If you're expecting that TextChanged event to fire here:
Code:
frm.Pass.Text = password;
frm.User.Text = username;

Which would explain why the MessageBox is showing and anything on the form isn't changing... Hence why I said earlier that you didn't provide enough information; this was the information needed.

Why does the messagebox show but the checkboxes don't re-enable though?

They do, everything you expect to happen, does happen. Just not on the form you think it should be happening to. This form that you're dealing with, just isn't being seen.

Why wouldn't it return an error though saying Form2 checkbox doesn't exist?
[Image: BAvhP6h.png]
Code:
[5:42:25 PM] i0xillusi0n: Breshie don't bust a nut over chloe now
[5:42:31 PM] Entity: fapfapfapfapfapfapfapfapfapfap
[5:42:33 PM] Jigglypuff | SL: EWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW

Reply

RE: Need some help - enabling checkboxes #20
(03-17-2013, 03:09 AM)i0xIllusi0n Wrote: Why wouldn't it return an error though saying Form2 checkbox doesn't exist?

Because it does exist lol....

If you have a checkbox on Form2 then it exists. What i'm talking about is that you're trying to change a new instance of Form2, you don't Show() it, and this is NOT the one that is already open (as Form2).
-- cxS

[ Haskell/.NET/C/C++ - Software Engineer ]

Reply







Users browsing this thread: 1 Guest(s)