ADGE devel on .NETfx

Last update: 2010/11/01 23:02 +0900

Overview

An experimental project … Rewrite ADGE, and make it run on Vista!

ADGE is written by rain` (member of DM.com).

I just enjoy rewrite of ADGE in my hobby.

Goals?

Issues:

2008.06.29

A screen shot is available. I published it at DM.com chat today midnight. It took a full day to fix all compiler errors.

Example of rewriting a AxListBox

Replace the AxListBox control. Here is memo:

Rewrite the code.

Before After

---
In these days, developer tended to hate to prepare many objects (e.g. allocate an item object per list item) because code cost and memory cost extremely increases per object.
So all the manipulation is done through parent control like ListBox.

---
.net controls ListView control adapt well object oriented idea. item's attributes (focus status, multi-column texts, etc) can be manipulated through each list item object ListViewItem.

DoorList.set_ListIndex(selecteddoor - 1)

---
VB's ListBox has ListIndex property to identify current focused item.

DoorList.Items(selecteddoor - 1).Focused = True

---
.NET ListView control has no ListIndex property. Each list item (ListViewItem) has Focused property. Set it True to focus the item, then other list item loses focus automatically.

selectdoor(DoorList.get_ListIndex() + 1)

 

selectdoor(DoorList.FocusedItem.Index + 1)

---
Use FocusedItem property to locate the actively focused item.

2008.07.03

Tips: how to remove AxCommandButton

For example, correct the button in RuneEditor form.

  1. Open RuneEditor.Designer.vb. Drag the file and drop into VB.net express system.
  2. Find keyword "axcom".
  3. You'll find Ok and Cancel control variables uses AxCommandButton class.
  4. Replace AxMicrosoft.Vbe.Interop.Forms.AxCommandButton with System.Windows.Forms.Button. 4 items'll be replaced.
  5. You'll get errors like 'OcxState' is not a member of 'System.Windows.Forms.Button'. Just remove 2 lines which mention OcxState errors. It is not needed for VB.net.
  6. Add 2 lines:
    Me.Ok.Text = "Ok"
    Me.Cancel.Text = "Cancel"
  7. Remove ISupportInitialize lines utilized for Ok and Cancel controls:


     
  8. Resolve errors Event 'ClickEvent' cannot be found. Just replace ClickEvent with Click.
  9. It's done!