Hello,
can anyone provide me an sample to get the last 3 controls in a panel please
i want to get from the last 3 controls the 'Text' that's inside the control
Thanks
-
- Top Members
- Reps
- Posts
-
- 1885 Replies
- 4376 Replies
-
- 855 Replies
- 2870 Replies
-
- 190 Replies
- 2821 Replies
-
- 834 Replies
- 2585 Replies
-
- 719 Replies
- 2577 Replies
-
- 687 Replies
- 2454 Replies
-
- 716 Replies
- 2026 Replies
-
- 871 Replies
- 1967 Replies
-
- 331 Replies
- 1928 Replies
-
- 68 Replies
- 1890 Replies
-
- 527 Replies
- 1758 Replies
-
- 436 Replies
- 1610 Replies
How to get the 3 last controls in a panel?
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
How to get the 3 last controls in a panel?
Wed Jul 26, 2017 3:21 pm
visit us on:

http://www.softpedia.com/get/System/Lau ... -Run.shtml
Check it out ! http://www.softpedia.com/publisher/I-A- ... 90017.html
Check it out ! http://www.softpedia.com/get/Desktop-En ... lock.shtml

http://www.softpedia.com/get/System/Lau ... -Run.shtml
Check it out ! http://www.softpedia.com/publisher/I-A- ... 90017.html
Check it out ! http://www.softpedia.com/get/Desktop-En ... lock.shtml
- CodenStuff
- Site Admin
- Posts: 4376
Re: How to get the 3 last controls in a panel?
Wed Jul 26, 2017 7:06 pm
Iterating through a panels controls starts from the last one anyway
Example:
Or quick and dirty to get the last 3 controls in the panel, in this case the text from textboxes:
Example:
Code: Select all
For Each control In Panel1.Controls
'Do something here
Next
Code: Select all
For i = 0 To 2
MsgBox(CType(Panel1.Controls(i), TextBox).Text)
Next
Welcome to CodenStuff.com Learn Code, Love Code. Thank you for being a member of the community.
Re: How to get the 3 last controls in a panel?
Wed Jul 26, 2017 9:32 pm
Hi Again,
How to get instead of an textbox just a string?
how do i get that please of the control
How to get instead of an textbox just a string?
how do i get that please of the control
Code: Select all
Public Property Description() As String
Get
Return _PText
End Get
Set(ByVal Value As String)
_PText = Value
Invalidate()
End Set
End Property
visit us on:

http://www.softpedia.com/get/System/Lau ... -Run.shtml
Check it out ! http://www.softpedia.com/publisher/I-A- ... 90017.html
Check it out ! http://www.softpedia.com/get/Desktop-En ... lock.shtml

http://www.softpedia.com/get/System/Lau ... -Run.shtml
Check it out ! http://www.softpedia.com/publisher/I-A- ... 90017.html
Check it out ! http://www.softpedia.com/get/Desktop-En ... lock.shtml
- CodenStuff
- Site Admin
- Posts: 4376
Re: How to get the 3 last controls in a panel?
Wed Jul 26, 2017 10:11 pm
I imagine it would be basically the same sort of thing.
Like
ctype(panel1.controls(I), textbox).Description()
Like
ctype(panel1.controls(I), textbox).Description()
Welcome to CodenStuff.com Learn Code, Love Code. Thank you for being a member of the community.
Re: How to get the 3 last controls in a panel?
Wed Jul 26, 2017 10:33 pm
I don't have any textbox or other controls
only strings liked i showed in my code
so how can we solved that please
only strings liked i showed in my code

so how can we solved that please
visit us on:

http://www.softpedia.com/get/System/Lau ... -Run.shtml
Check it out ! http://www.softpedia.com/publisher/I-A- ... 90017.html
Check it out ! http://www.softpedia.com/get/Desktop-En ... lock.shtml

http://www.softpedia.com/get/System/Lau ... -Run.shtml
Check it out ! http://www.softpedia.com/publisher/I-A- ... 90017.html
Check it out ! http://www.softpedia.com/get/Desktop-En ... lock.shtml
Re: How to get the 3 last controls in a panel?
Thu Jul 27, 2017 6:17 am
Hello,
NVM got it
i just needed to replace it with my own control hahaha
stupid me
hmmm weird, nothing shows up :(
i get only a sort of error message that shows me the line number but no error?
NVM got it
i just needed to replace it with my own control hahaha
stupid me

hmmm weird, nothing shows up :(
i get only a sort of error message that shows me the line number but no error?
visit us on:

http://www.softpedia.com/get/System/Lau ... -Run.shtml
Check it out ! http://www.softpedia.com/publisher/I-A- ... 90017.html
Check it out ! http://www.softpedia.com/get/Desktop-En ... lock.shtml

http://www.softpedia.com/get/System/Lau ... -Run.shtml
Check it out ! http://www.softpedia.com/publisher/I-A- ... 90017.html
Check it out ! http://www.softpedia.com/get/Desktop-En ... lock.shtml
Re: How to get the 3 last controls in a panel?
Thu Jul 27, 2017 7:37 am
OKay found it
but still don't get the last 3 controls :(
it shows 1 last control if i use exit sub
then it stops
if i delete the exit sub then it shows 3 times the first control instead of the 3 last ones
but still don't get the last 3 controls :(
it shows 1 last control if i use exit sub
then it stops
if i delete the exit sub then it shows 3 times the first control instead of the 3 last ones
Code: Select all
For i = 0 To 2
Select Case i
Case 0
For Each ctl As Control In ITransactionControl1.IPanel1.Controls
If TypeOf ctl Is ITransaction Then
Label31.Text = CType(ctl, ITransaction).Description
' Exit Sub
End If
Next
Case 1
' MsgBox(CType(ITransactionControl1.IPanel1.Controls(2), ITransaction).Description)
For Each ctl As Control In ITransactionControl1.IPanel1.Controls
If TypeOf ctl Is ITransaction Then
Label4.Text = CType(ctl, ITransaction).Description
' Exit Sub
End If
Next
Case 2
For Each ctl As Control In ITransactionControl1.IPanel1.Controls
If TypeOf ctl Is ITransaction Then
Label27.Text = CType(ctl, ITransaction).Description
' Exit Sub
End If
Next
End Select
Next
visit us on:

http://www.softpedia.com/get/System/Lau ... -Run.shtml
Check it out ! http://www.softpedia.com/publisher/I-A- ... 90017.html
Check it out ! http://www.softpedia.com/get/Desktop-En ... lock.shtml

http://www.softpedia.com/get/System/Lau ... -Run.shtml
Check it out ! http://www.softpedia.com/publisher/I-A- ... 90017.html
Check it out ! http://www.softpedia.com/get/Desktop-En ... lock.shtml
Re: How to get the 3 last controls in a panel?
Thu Jul 27, 2017 8:39 am

think i found the solution
Code: Select all
For I As Integer = 0 To ITransactionControl1.IPanel1.Controls.Count - 1
If TypeOf ITransactionControl1.IPanel1.Controls.Item(I) Is ITransaction Then
Select Case I
Case 1
Label31.Text = CType(ITransactionControl1.IPanel1.Controls.Item(I), ITransaction).Description
Case 2
Label4.Text = CType(ITransactionControl1.IPanel1.Controls.Item(I), ITransaction).Description
Case 3
Label27.Text = CType(ITransactionControl1.IPanel1.Controls.Item(I), ITransaction).Description
End Select
End If
Next

EDIT:
pfff don't get it working, still don't get the last 3 controls
seems the case functions don't work the way we count it
hope someone can give me a better solution

Thanks
visit us on:

http://www.softpedia.com/get/System/Lau ... -Run.shtml
Check it out ! http://www.softpedia.com/publisher/I-A- ... 90017.html
Check it out ! http://www.softpedia.com/get/Desktop-En ... lock.shtml

http://www.softpedia.com/get/System/Lau ... -Run.shtml
Check it out ! http://www.softpedia.com/publisher/I-A- ... 90017.html
Check it out ! http://www.softpedia.com/get/Desktop-En ... lock.shtml
- CodenStuff
- Site Admin
- Posts: 4376
Re: How to get the 3 last controls in a panel?
Sat Jul 29, 2017 11:06 am
Which controls is it getting?
Instead of CASE 1/2/3 have you tried CASE 0/1/2 ...remember it starts from 0
Instead of CASE 1/2/3 have you tried CASE 0/1/2 ...remember it starts from 0
Welcome to CodenStuff.com Learn Code, Love Code. Thank you for being a member of the community.
Re: How to get the 3 last controls in a panel?
Sat Jul 29, 2017 11:13 am
hi again,
this is the result with the code

what are we doing wrong :( why do i get only 1 record in the left column?
Edit:
I also needed the last 3 records that has been added as last
963,lol,pol
not from the last 3 bottoms
this is the result with the code
Code: Select all
For I As Integer = 0 To ITransactionControl1.IPanel1.Controls.Count - 1
If TypeOf ITransactionControl1.IPanel1.Controls.Item(I) Is ITransaction Then
Select Case I
Case 0
Label31.Text = CType(ITransactionControl1.IPanel1.Controls.Item(I), ITransaction).Description
Case 1
Label4.Text = CType(ITransactionControl1.IPanel1.Controls.Item(I), ITransaction).Description
Case 2
Label27.Text = CType(ITransactionControl1.IPanel1.Controls.Item(I), ITransaction).Description
End Select
End If
Next

what are we doing wrong :( why do i get only 1 record in the left column?
Edit:
I also needed the last 3 records that has been added as last
963,lol,pol
not from the last 3 bottoms
visit us on:

http://www.softpedia.com/get/System/Lau ... -Run.shtml
Check it out ! http://www.softpedia.com/publisher/I-A- ... 90017.html
Check it out ! http://www.softpedia.com/get/Desktop-En ... lock.shtml

http://www.softpedia.com/get/System/Lau ... -Run.shtml
Check it out ! http://www.softpedia.com/publisher/I-A- ... 90017.html
Check it out ! http://www.softpedia.com/get/Desktop-En ... lock.shtml
Jump to
- Welcome to CodenStuff
- ↳ Announcements
- ↳ Introduce Yourself
- The zone
- ↳ Codenstuff boardroom
- ↳ Game Room
- ↳ Competitions
- ↳ SoTW
- ↳ Mad March Challenge Archive
- ↳ Mad March Daily Challenge
- App Shelf
- ↳ The Showcase
- ↳ Work in Progress
- ↳ Source-Code
- ↳ Full Software
- Software Programming
- ↳ Visual Basic .Net
- ↳ Tutorials
- ↳ Quick Snips
- ↳ Tutorial Requests
- ↳ Coding Help & Support
- ↳ Videos
- ↳ C# Sharp
- ↳ C-Sharp Tutorials
- ↳ Quick Snips
- ↳ General coding help
- ↳ C++
- ↳ C++ Tutorials
- ↳ Quick Snips
- ↳ General coding help
- ↳ Visual Basic 6
- ↳ VB6 Tutorials
- ↳ Quick Snips
- ↳ General coding help
- ↳ XNA
- ↳ Tutorials
- ↳ Help & Support
- ↳ DirectX
- ↳ Tutorials
- ↳ Help & Support
- ↳ Tools and Components
- ↳ Custom Controls
- ↳ Dynamic Link Libraries (DLLs)
- ↳ Templates
- ↳ API and SDK
- ↳ Add-ins and extensions
- ↳ Other Languages
- ↳ Misc
- ↳ Game Maker
- ↳ MonoGame
- ↳ Unity
- Web Programming
- ↳ HTML
- ↳ Tutorials
- ↳ Help & Support
- ↳ xHTML
- ↳ Tutorials
- ↳ Help & Support
- ↳ CSS
- ↳ Tutorials
- ↳ Help & Support
- ↳ HTML5
- ↳ Tutorials
- ↳ Help & Support
- ↳ Java-Script
- ↳ Tutorials
- ↳ Help & Support
- ↳ Flash
- ↳ Tutorials
- ↳ Help & Support
- ↳ Web Design Software
- ↳ Dreamweaver
- ↳ Fireworks
- ↳ Adobe Illustrator
- ↳ Chrome
- ↳ Tutorials
- ↳ Apps & Extensions
- ↳ Help & Support
- ↳ Mozilla FireFox
- ↳ Plugins, Addons, Extensions
- ↳ Help & Support
- ↳ phpBB
- ↳ General Discussion
- ↳ Help & Support
- ↳ MOD Downloads
- ↳ Other Languages
- Server Programming
- ↳ SQL - MySQL
- ↳ MySQL- SQL Tutorials
- ↳ Help & Support
- ↳ Perl/CGI
- ↳ Tutorials
- ↳ Help & Support
- ↳ PHP
- ↳ Tutorials
- ↳ Help & Support
- ↳ ASP / ASP.Net
- ↳ Tutorials
- ↳ Help & Support
- ↳ Python
- ↳ Tutorials
- ↳ Help & Support
- App & Mobile Programming
- ↳ Windows 10 UWP
- ↳ Windows 10 General Discussion
- ↳ Code Tutorials
- ↳ Javascript
- ↳ Visual Basic
- ↳ C Sharp
- ↳ C++
- ↳ DirectX
- ↳ html / xaml / css
- ↳ Other tutorials
- ↳ Coding Help & Support
- ↳ Javascript
- ↳ Visual Basic
- ↳ C Sharp
- ↳ C++
- ↳ DirectX
- ↳ html / xaml / css
- ↳ Other coding help
- ↳ iOS - iPhone/iPad
- ↳ Tutorials
- ↳ Help & Support
- ↳ Resources
- ↳ Android
- ↳ Tutorials
- ↳ Help & Support
- ↳ Resources
- ↳ Raspberry Pi
- ↳ General Discussion
- ↳ Tutorials
- ↳ Help & Support
- ↳ Construct 2
- ↳ General Discussion
- ↳ Tutorials
- ↳ Help & Support
- Graphics & Media - Hungryhounds Kennel
- ↳ Skins & Themes
- ↳ GFX Media
- ↳ GFX Tutorials
- ↳ Sound Rack
- ↳ 3D Software
- ↳ Help & Support
- Technology & Entertainment
- ↳ Movies & TV
- ↳ Movies
- ↳ TV Shows
- ↳ Gaming
- ↳ XBox
- ↳ Playstation
- ↳ Wii
- ↳ Nintendo DS
- ↳ PC Games
- ↳ Accessories & Hardware
- ↳ PC & Tablets
- ↳ PC
- ↳ MAC
- ↳ Tablets
- ↳ Mobiles
- ↳ Phones
- ↳ Accessories
- Coders Corner
- ↳ Get Together
- ↳ Code Storming
- ↳ Community Projects
- ↳ Codenstuff API
- ↳ CnS Desktop
- ↳ CnS Desktop Main
- ↳ CnS SideBar
- ↳ Add-Ins
- ↳ Full Apps
- ↳ Tool Bars
- ↳ SideBar
- ↳ Extended
- ↳ Tutorials
- ↳ CnS Social
- ↳ CodeWars
- ↳ Group Shelter
- ↳ Technical Support
- ↳ Website Help & Suggestions
- ↳ Installing Software
- ↳ General Help
- ↳ Miscellaneous
- ↳ Programming Software
- ↳ eBooks
- ↳ For Sale & Wanted
- ↳ Misc
- ↳ Other Operating Systems
- ↳ MAC
- ↳ General Discussion
- ↳ Programming
- ↳ Software
- ↳ Help & Support
- ↳ Linux
- ↳ General Discussion
- ↳ Programming
- ↳ Software
- ↳ Help & Support
- ↳ Services for hire