如果我有OK和取消,使用标准按钮,默认为OK,我按右箭头,取消聚焦,按键盘上的Enter键,调用取消按钮功能。
ownerdraw按钮不会发生这种情况。如果我按向右箭头,则取消按钮,但按键盘上的Enter键将调用OK按钮功能。
如何拥有标准行为的ownerdraw按钮?
这是我的班级。
query = "SELECT * FROM `ignore_lists` WHERE `ignore_owner`='$id' ORDER BY `person_being_ignored` ASC";
$result = mysqli_query($link, $query); // execute the query
if (mysqli_num_rows($result) > 0) {
while($mrow = mysqli_fetch_array($result)) {
$ignoree_name = $mrow['name_of_ignored'];
$query3 = "SELECT * FROM `$room` WHERE sender <> '$ignoree_name'";
// $query3 = "SELECT * FROM(SELECT `message`, `id`, `timestamp`, `color` FROM `$room` WHERE sender <> '$ignoree_name' ORDER BY `id` DESC LIMIT $len) AS `id` ORDER BY `id` ASC";
$result3 = mysqli_query($link, $query3); // execute the query
}
while($row = mysqli_fetch_array($result3)) {
$showmsg = htmlspecialchars_decode($row["message"]);
echo "$showmsg<br>";
}
} elseif(mysqli_num_rows($result) < 1) {
$query3 = "SELECT * FROM(SELECT `message`, `id`, `timestamp`, `color` FROM `$room` ORDER BY `id` DESC LIMIT $len) AS `id` ORDER BY `id` ASC";
$result3 = mysqli_query($link, $query3); // execute the query
if (mysqli_num_rows($result3) > 0) {
while($row = mysqli_fetch_assoc($result3)) {
$showmsg = htmlspecialchars_decode($row["message"]);
echo "$showmsg<br>";
}}}}
答案 0 :(得分:2)
主要原因是Dialog通常使用BS_DEFPUSHBUTTON和BS_PUSHBUTTON来指示这一点,但ownerdraw标志与之相互排斥。
检查这篇文章:它解释了完整的背景: http://www.codeproject.com/Articles/1318/COddButton