943,912 Members | Top Members by Rank

Ad:
  • VB.NET Discussion Thread
  • Marked Solved
  • Views: 924
  • VB.NET RSS
Jun 16th, 2008
0

Problem Displaying Items

Expand Post »
hello,
I am having a problem getting all of my items to display correctly. I have a form that has a combobox. When this combobox changes I need to display different items on the form. This is the code to do this but for some strange reason not all items are set to visible.

vb.net Syntax (Toggle Plain Text)
  1. Public Function clear() As Boolean
  2. grpDate.Visible = False
  3. grpDoct.Visible = False
  4. grpHide.Visible = False
  5. grpMain.Visible = False
  6. grpOptions.Visible = False
  7. grpPatHasIns.Visible = False
  8. grpSig.Visible = False
  9. grpZip.Visible = False
  10. grpInv.Visible = False
  11. grpInsurance.Visible = False
  12. grpDur.Visible = False
  13. End Function
  14. Private Sub cboReport_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cboReport.SelectedIndexChanged
  15. Select Case cboReport.SelectedIndex
  16. Case 0 'Daily Totals
  17. clear()
  18. grpHide.Visible = True
  19. grpDate.Visible = True
  20. Case 1 'Daily Prescriptions
  21. clear()
  22. grpMain.Visible = True
  23. grpDate.Visible = True
  24. txtMainZip.Visible = True
  25. chkMainShowDirect.Visible = True
  26. Case 2 'Patient Profile
  27. clear()
  28. grpMain.Visible = True
  29. grpDate.Visible = True
  30. Case 3 'Patient Info
  31. clear()
  32. grpZip.Visible = True
  33. grpPatHasIns.Visible = True
  34. Case 4 'Doctor Info
  35. clear()
  36. Me.grpZip.Visible = True
  37. Case 5 'Insurance Analysis
  38. clear()
  39. grpDate.Visible = True
  40. grpInsurance.Visible = True
  41. Case 6 'Drug Inventory
  42. clear()
  43. grpInv.Visible = True
  44. Case 7 'DUR
  45. clear()
  46. grpDur.Visible = True
  47. grpDate.Visible = True
  48. grpDoct.Visible = True
  49. Case 8 'SIG Codes
  50. clear()
  51. grpSig.Visible = True
  52. Case 9 'Current Medications (Refills Available)
  53. clear()
  54. grpDate.Visible = True
  55. grpMain.Visible = True
  56. chkMainShowSig.Visible = True
  57. chkMainShowVoid.Visible = True
  58. lblMainFacility.Visible = False
  59. lblMainZip.Visible = False
  60. chkMainShowDirect.Visible = False
  61. chkMainRphSig.Visible = False
  62. txtMainFacility.Visible = False
  63. txtMainZip.Visible = False
  64. Case 10 'Delivery Ticket
  65. clear()
  66. grpDate.Visible = True
  67. grpMain.Visible = True
  68. chkMainPatSig.Visible = False
  69. chkMainShowCost.Visible = True
  70. chkMainShowPrice.Visible = True
  71. chkMainqty.Visible = True
  72. lblMainZip.Visible = False
  73. lblMainFacility.Visible = True
  74. txtMainFacility.Visible = True
  75. chkMainRphSig.Visible = False
  76. chkMainShowDirect.Visible = False
  77. chkMainShowSig.Visible = False
  78. Case 11 'Pickup Ticket
  79. clear()
  80. grpMain.Visible = True
  81. grpDate.Visible = True
  82. chkMainShowSig.Visible = False
  83. chkMainShowCost.Visible = False
  84. chkMainShowPrice.Visible = True
  85. txtMainZip.Visible = False
  86. lblMainZip.Visible = False
  87. chkMainShowVoid.Visible = False
  88. Case 12 'Refill Compliance
  89. clear()
  90. grpDoct.Visible = True
  91. grpDate.Visible = True
  92. grpMain.Visible = True
  93. chkMainShowPrice.Visible = False
  94. chkMainShowCost.Visible = False
  95. chkMainShowVoid.Visible = False
  96. chkMainShowDirect.Visible = False
  97. End Select
  98. End Sub

Any ideas and tips are greatly appreciated.

Thanks
Similar Threads
Reputation Points: 31
Solved Threads: 29
Posting Whiz in Training
ProfessorPC is offline Offline
270 posts
since Dec 2007
Jun 17th, 2008
0

Re: Problem Displaying Items

I would guess these are textboxes or labels. If there is no text in them and no border and the backcolor is the same as the form then you will not see anything. Try using a border around them and see if that doesn't solve you problem.
Reputation Points: 84
Solved Threads: 58
Posting Pro in Training
waynespangler is offline Offline
461 posts
since Dec 2002
Jun 17th, 2008
0

Re: Problem Displaying Items

Can you tell specifically, when selecting an item which item(control) is not visible.
Reputation Points: 44
Solved Threads: 101
Posting Pro
selvaganapathy is offline Offline
547 posts
since Feb 2008
Jun 17th, 2008
0

Re: Problem Displaying Items

I have a groupbox grpmain that will not display. Some other objects are not displaying as well but the main one is the grpmain.
Reputation Points: 31
Solved Threads: 29
Posting Whiz in Training
ProfessorPC is offline Offline
270 posts
since Dec 2007
Jun 17th, 2008
0

Re: Problem Displaying Items

Have you stepped thru the code to see if the visible portion is being executed?
Reputation Points: 84
Solved Threads: 58
Posting Pro in Training
waynespangler is offline Offline
461 posts
since Dec 2002
Jun 17th, 2008
0

Re: Problem Displaying Items

i have stepped through the code. it hits the code to set visible = true but after continuing and i mouse over the visibility is still set to false. very odd.
Reputation Points: 31
Solved Threads: 29
Posting Whiz in Training
ProfessorPC is offline Offline
270 posts
since Dec 2007
Jun 17th, 2008
1

Re: Problem Displaying Items

I just ran your code. All the group boxes showed up like they should. I did see that you are hiding some controls in places in your code and not showing them again. Click on "Daily Pescription" and you will see all the controls (textboxes, labels and checkboxes). Now click on "Pickup Ticket" and some of the controls are turned off. Now click on "Daily Pescription" and then ones turned off in "Pickup Ticket" are still turned off. This is inconsistent.
As for the group boxes they do turn on and off as expected.
You might have to reinstall vb.......
Reputation Points: 84
Solved Threads: 58
Posting Pro in Training
waynespangler is offline Offline
461 posts
since Dec 2002
Jun 18th, 2008
0

Re: Problem Displaying Items

i havent really went as far as displaying everything as its needed. I have ran into this problem of the main grp not displaying correctly. without that group there isnt much else i could really do so i was concentrating on that more then the other items.
i was afraid of the reinstall being the option. thanks for you time in helping with this. I am off to reinstall.
Reputation Points: 31
Solved Threads: 29
Posting Whiz in Training
ProfessorPC is offline Offline
270 posts
since Dec 2007

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in VB.NET Forum Timeline: Filter DataSource before presente data in gridview
Next Thread in VB.NET Forum Timeline: Search for files within certain date range





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC