如何清除图片框上的绘图图像?以下对我没有帮助:
pictbox.Image = null;
pictbox.Invalidate();
Run Code Online (Sandbox Code Playgroud)
请帮忙.
编辑
private void pictbox_Paint(object sender, PaintEventArgs e)
{
Graphics g = e.Graphics;
vl.Draw(g, ref tran.realListForInsert);
}
public void Draw(Graphics g, ref List<double> arr)
{
g.DrawRectangle(new Pen(Brushes.Red, 3), nodeArr[Convert.ToInt32(templstName)].pict.Location.X, nodeArr[Convert.ToInt32(templstName)].pict.Location.Y, 25, 25);
g.DrawRectangle(new Pen(Brushes.Green, 3), nodeArr[Convert.ToInt32(templstArgName)].pict.Location.X, nodeArr[Convert.ToInt32(templstArgName)].pict.Location.Y, 25, 25);
nodeArr[Convert.ToInt32(templstName)].text.Text = arr[Convert.ToInt32(templstArgName)].ToString();
arr[Convert.ToInt32(templstName)] = arr[Convert.ToInt32(templstArgName)];
}
Run Code Online (Sandbox Code Playgroud) 我想获得wordpress网站中的所有类别,但是分别是父类和子类(以这种方式,我很容易为其设置风格).在下面的代码中,我获得了父类别,但是每个父类都重复了所有子类别.谢谢!
<?php
$args = array(
'orderby' => 'name',
'parent' => 0
);
$categories = get_categories( $args );
$categories_sub = get_categories();
foreach ( $categories as $category ) {
echo '<ul class=" span-5 colborder list_main "> <a href="' . get_category_link( $category->term_id ) . '">' . $category->name . '</a><br/>';
foreach ( $cat->parent > 1 and $categories_sub as $cat) {
$temp=$category->name + '/';
if(get_category_parents($cat)==$temp) {
echo '<a href="' . get_category_link( $cat->term_id ) . '">' . $cat->name . '</a><br/>';
}
$temp="";
}
echo '</ul>';
} …Run Code Online (Sandbox Code Playgroud)