TRIS sets whether the pin should be output or input. If TRISB2_bit is set to 1, PORTB2 is set as input. If TRISB2_bit is set to 0, PORTB2 is set as output.
In PIC18 when writing to the ports, you should write to LAT. If you want PORTB2 to output 1, write