
www.Usenet.com
| <-- __Chronological__ --> | <-- __Thread__ |
Thanks oLb:CurrentItemNo sems to be working now. I'm almost sure I tried it before, but perhaps something else was broken at the time! "NSG" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Ian, > > From memory _cast is used for pointer type conversions. Put simply cast > changes a variable from one type to another. If you're just learning then > you probably don't need it. > > As for your listbox problem very simple. You can assign values:- > > oDCMyListbox:TextValue:="This is the text displayed in the listbox" > > similar > > oDCMyListbox:CurrentItem:="This is the text displayed in the listbox" > > or > > oDCMyListBox:Value:="This is the return value of the list box" > > or > > oDCMyListBox:CurrentItemNo:=99 -- numeric value representing position in > the list. > > "Ian Henderson" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > Upfront apology for yet another newbie ques. + rant ! > > > > I was looking for a way to set the currently selected item for a listbox > > from a method (as opposed to responding to a user click). > > After much trial and error, tedious searching the NGs, win32SDK and Vo > SDK > > I finally found somethoing that works: > > > > SendMessage( SELF:oDcMyListbox:Handle() , LB_SETCURSEL , DWORD(_CAST, > > nSel-1 ) , 0) > > > > I have to use nSel -1 because, acording to win32 SDK the listbox is zero > > based. > > > > This i arrived at mainly through trial and error and reading the docs, > > loking at the SDKs. However I don't like to use stuff i don't fully > > understand. > > So ... what the heck is _CAST, it doesn't seem documented anywhere. > > > > BTW did any of you find, when you were first learning the language, as I > am, > > that as great and powerful as it is, VO developers left out a lot of > basic > > stuff that you had to figure out yourself? > > Take the eg just mentioned. Most other environments would likely allow you > > to set a listbox simply with something like: > > oListBox:CurSelect := nSel It would be so obvious and intuitive. > > > > Is it that the language was pitched at mainly C or C++ programmers > familiar > > with windows api experience? Or is it that a lot of stuff was left out due > > to bringing it to market? Or was it purposely designed with minimal > > functionality (clutter) in some of the basic classes? > > Or maybe I'm just ranting because it took so long to do something pretty > > basic. <bg> > > > > Regards > > IanH > > > > > > > >
| <-- __Chronological__ --> | <-- __Thread__ |