P
Phillip Taylor
I have made my own custom control. It looks like a single line textbox
with icons on the right hand side. It pretty much has the same
functionality as Microsoft Outlooks "To" field, where you can Alt-K to
complete things etc. Mine has a different purpose but is essentially
the same style.
Anyway the issue I have is managing the complexity of the box. the
user can interact by clicking buttons to open search windows, type
names directly into the text box or by setting it programatically (?)
using the exposed properties.
It leads to extremely complex code like this however:
public property ObjectID as Int32
....
set(value as Int32)
if (inMethod) then exit sub
inMethod = true
textbox.text = lookup(value)
icon = imageX
me.mObjectId = value
inMethod = false
end set
--
There is no said problem per say, but I need things like inMethod
booleans to stop a nightmare of redundant callbacks and invocations of
bad text. I don't feel I could centrallise this because each technique
works with different inputs. (i.e. Int32, or String, or result from
search window) etc.
Is there a good design pattern or common solution that makes working
with this kind of code easier?
Phillip Taylor
with icons on the right hand side. It pretty much has the same
functionality as Microsoft Outlooks "To" field, where you can Alt-K to
complete things etc. Mine has a different purpose but is essentially
the same style.
Anyway the issue I have is managing the complexity of the box. the
user can interact by clicking buttons to open search windows, type
names directly into the text box or by setting it programatically (?)
using the exposed properties.
It leads to extremely complex code like this however:
public property ObjectID as Int32
....
set(value as Int32)
if (inMethod) then exit sub
inMethod = true
textbox.text = lookup(value)
icon = imageX
me.mObjectId = value
inMethod = false
end set
--
There is no said problem per say, but I need things like inMethod
booleans to stop a nightmare of redundant callbacks and invocations of
bad text. I don't feel I could centrallise this because each technique
works with different inputs. (i.e. Int32, or String, or result from
search window) etc.
Is there a good design pattern or common solution that makes working
with this kind of code easier?
Phillip Taylor