Hey all

I have a level named labelEVdiffVal. Now the app updates this level with text either +0.1% +0.2% etc

I basiacly want to do if (labelEVdiffVal = "+0.1%) or +0.2% or +0.3% etc etc then { do this }

or it can be if label > +0.1%, but the text is written as +0.1% and cannot be changed to just text as also had -0.1% + numbers which i need to execute different code for if its -%

If i try the code above it sais cannot impicitly convert type 'string' to 'system.windows.forms.label'

basiacly its a program is text is +0.1% or greater I want to send an f1 key to the handle of the window if its 0.0 or -0.1% or greater then it will send f2 key to window

its a poker bot so when a table comes to top it currently calculates weather its a + or - ev move and writes the EV in that label and now i want to sendkeys if + or - to let a hotkey program either raise or fold (hotkey program if you press f1 it folds)

Code:
private void GetActiveWindow()
        {
            const int nChars = 256;
            int handle = 0;
            StringBuilder Buff = new StringBuilder(nChars);
            handle = GetForegroundWindow();

            if (GetWindowText(handle, Buff, nChars) > 0)
            {
                this.textBox1.Text = handle.ToString();

                for (int i = 0; i < listBoxTables.Items.Count; i++)
                    if (((PokerTable)listBoxTables.Items[i]).HWND.ToInt32() == handle)

                {
                    listBoxTables.SelectedIndex = i;
                    setFormsAndDoCalc(true, null);
                    SetForegroundWindow(handle);
                    if (labelEVdiffVal = "+0.1%")
                    {
                        SendKeys.SendWait("({F2})");
                    };
                    return;
                }

            }
        }
What this code is doing is when pokertable comes to the top it then finds it in the list of poker tables then it makes calculations and displays EV value then it brings table back to foreground (All works fine). I just now need the if label = this value then sendkeys to that window (which will be foreground now anyway)?

Is there anyway to do this and will it work as I would like?

Thanks!!