how do i handle the forms paint event

时间:2016-02-12 21:20:01

标签: c# winforms gdi+

I have created a form and would like to use this code example:

https://msdn.microsoft.com/en-us/library/5ey6h79d%28v=vs.110%29.aspx

The instruction with the code is:

To run this example, paste it into a form and handle the form's Paint event by calling the LockUnlockBitsExample method, passing e as PaintEventArgs.

I have pasted the code into the form but I have no idea how to handle the form's paint event.

 public class MainActivity extends Activity {

    ListView lv;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.activity_main);

        lv = (ListView) findViewById(R.id.listView);
        lv.setAdapter(new customListAdapter(this, new String[]{"Switch 1", "Switch 2 ", "Switch 3", "Switch 4", "Switch 5", "Switch 6", "Switch 7"}));

    }
}

1 个答案:

答案 0 :(得分:1)

You should be able to override the OnPaint Method

localhost