我正在努力实现一些非常简单的事情,但我的问题非常小。我有一个TextBox,用户需要输入Type。类型应该只是'1'或'a'。我想到的是当用户输入的值不是这些值时,将BorderBrush更改为红色。
这似乎有效但是为了将颜色变成红色,我需要输入两个字母......所以如果我只按d,它将是灰色的,如果按dd它将变为红色。有没有办法让它在第一个字母上变红?
[ 65%] Built target wangle
Linking CXX executable bin/AcceptorTest
/usr/bin/ld: warning: libboost_filesystem.so.1.54.0, needed by /usr/local/lib/libfolly.so, may conflict with libboost_filesystem.so.1.61.0
/usr/bin/ld: warning: libboost_system.so.1.54.0, needed by /usr/local/lib/libfolly.so, may conflict with libboost_system.so.1.61.0
/usr/local/lib/libfolly.so: undefined reference to `boost::re_detail_106000::perl_matcher<char const*, std::allocator<boost::sub_match<char const*> >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::construct_init(boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > > const&, boost::regex_constants::_match_flags)'
/usr/local/lib/libfolly.so: undefined reference to `boost::re_detail_106000::get_mem_block()'
/usr/local/lib/libfolly.so: undefined reference to `boost::re_detail_106000::cpp_regex_traits_implementation<char>::transform_primary(char const*, char const*) const'
/usr/local/lib/libfolly.so: undefined reference to `boost::re_detail_106000::verify_options(unsigned int, boost::regex_constants::_match_flags)'
/usr/local/lib/libfolly.so: undefined reference to `boost::re_detail_106000::get_default_error_string(boost::regex_constants::error_type)'
/usr/local/lib/libfolly.so: undefined reference to `boost::re_detail_106000::perl_matcher<__gnu_cxx::__normal_iterator<char const*, std::string>, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::string> > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::construct_init(boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > > const&, boost::regex_constants::_match_flags)'
/usr/local/lib/libfolly.so: undefined reference to `boost::re_detail_106000::put_mem_block(void*)'
/usr/local/lib/libfolly.so: undefined reference to `boost::re_detail_106000::raise_runtime_error(std::runtime_error const&)'
/usr/local/lib/libfolly.so: undefined reference to `boost::re_detail_106000::cpp_regex_traits_implementation<char>::transform(char const*, char const*) const'
collect2: error: ld returned 1 exit status
make[2]: *** [bin/AcceptorTest] Error 1
make[1]: *** [CMakeFiles/AcceptorTest.dir/all] Error 2
make: *** [all] Error 2
答案 0 :(得分:0)
谢谢大家的回复。看起来它已经在工作但是BorderBrush总是蓝色的,因为......聚焦时文本框边框总是蓝色(ish):D。所以我只是在它周围添加了一个边框,并在边框上添加了触发器。