Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

vbtab and listbox

Status
Not open for further replies.

SMURF75

Programmer
Aug 28, 2004
87
GB
Hi!

Im doing something wrong here... obviously
Code:
.
Friend WithEvents lboInfo As System.Windows.Forms.ListBox
.
.
lboInfo.Items.Add("Employee" & vbTab & oRefillData.UserId)
.

When item is added to listbox it shows as:Employee?A12
The way i want it to look is ofcourse:Employee A12

Any tips anyone... btw code is for CF.NET, I couldnt find such a forum.. but maybe i just searched bad

Excuse me for my English. Excuse me that im slow. Excuse me that i dont understand.
Excuse me for my signature but now i dont have to write this in every single post :D
 
Not sure what CF.Net is (C# maybe?) but you should try ControlChars.Tab instead of vbTab

-Rick

----------------------

[monkey] I believe in killer coding ninja monkeys.[monkey]
 
CF = Compact Framework, im developing application to run in Windows Mobile 2003.

Excuse me for my English. Excuse me that im slow. Excuse me that i dont understand.
Excuse me for my signature but now i dont have to write this in every single post :D
 
CF = Compact Framework, im developing application to run in Windows Mobile 2003.

ControlChars.Tab produced the same result.

Excuse me for my English. Excuse me that im slow. Excuse me that i dont understand.
Excuse me for my signature but now i dont have to write this in every single post :D
 
Ahhh, well, if ControlChars is available, I would recommend using it over referencing the VB library for the vbTab constant. If it's not available, try chr(9). I think 9 was tab, maybe it was 11 though.

-Rick

----------------------

[monkey] I believe in killer coding ninja monkeys.[monkey]
 
Ascii for tab was 11 but unfortunately that didnt work either

- - - - - - - - - - - - - - - - - -
Im three apples high, Im blue, and i most certainly like that cold beer that should be every mans right after a hard days work!
 
With a little more reading I found out that the useTabStops property is not supported by Compact Framework. So the idea to create columns in listbox using tabs just have to go to the recycle bin. If anyone have another good idea about how to solve it im all ears.

- - - - - - - - - - - - - - - - - -
Im three apples high, Im blue, and i most certainly like that cold beer that should be every mans right after a hard days work!
 
TabStops is not the same thing as a tab character. TabStops are when you press the "Tab" button, the focus moves to the next control that has the TabStop property set to true.

The issue here is that I'm guessing you are trying to create a 2 column listbox. you may be better off with a more robust system then a tab character anyways. do a search on the forum here for multi column listbox or combobox. It's been covered befor.

-Rick

----------------------

[monkey] I believe in killer coding ninja monkeys.[monkey]
 
Def. of useTabStops at msdn : Gets or sets a value indicating whether the ListBox can recognize and expand tab characters when drawing its strings.
Maybe is dont understand this correctly, but it seems like this property is all about strings? Or am I seriosly mistaken?
And i also hate to have to dismiss all of your tips ThatRickGuy, but the truth is that multicolumn property also lacks support in CF. Maybe I'll have to go with a listview solution instead. Thanks anyway.



- - - - - - - - - - - - - - - - - -
Im three apples high, Im blue, and i most certainly like that cold beer that should be every mans right after a hard days work!
 
Wow, my mistake. I would like to mention that the property name "useTabStops" is completely retarded, and if I ever meet the moron who chose that name I would have some not so kind words for him.

GUI objects have 2 other properties call "TabStop" which is a boolean indicating that a control should be included in the tab loop. And "TabIndex" which is the object's position in the tab loop. You can see where my confussion came from.

As for your situation, I would suggest using the best tool for the job. Creating a 2 column listbox can be challanging and time consuming. Where as a list view can be added to the project and you can be up and running in seconds. Guess which one I'm going to vote for ;)

Time invested doesn't matter if there is a better solution that can be implimented to save more time. If after 8 hours of trying to make a new wheel I find Acme Co makes WagonWheel(tm) that fits my system, I'm not going to waste 8 more hours trying to reinvent the wheel.

-Rick

----------------------

[monkey] I believe in killer coding ninja monkeys.[monkey]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top