Jump to content
Xtreme .Net Talk

hog

Avatar/Signature
  • Posts

    1011
  • Joined

  • Last visited

Everything posted by hog

  1. Hi, ok a kind of version on some suggestions made. I have decided to run some code to obtain the indexes of the controls on the tab pages, I only need to do this once during development. I will then store these into arrays as the form opens and use the arrays in my loops to reference required controls. Messy I know but there you go. I read about hashtables and this seems pretty much the same result as what I'm doing, but with more work. The usercontrol option is too much like hard work at this stage as well as the fact I would still have the same problem referencing only the required controls following each user selection. Heiko I think you are in tune with my problem :-)
  2. PS the tab control I am using is from System.Windows.Forms.Tabcontrol
  3. Mmm, me thinks I probably am not explaining myself? If for example a user selects a record which requires 4 tab pages of info then I need to restrict the code to updating of 4 pages only. So if I have a loop going from 1 to 4 the loop as you say would reference them by name, but what of the next record the user selects which only has 2 pages required? Then the other pages 3 and four would still be being referenced in the loop?
  4. Heiko, no that won't work as the user needs to input data. The idea is each tab page represents a service date whereby the user inputs service data.
  5. Just a thought here.... You both seem to think that this is a weird thing I'm trying to achieve? How would you tackle this prblem then, re control referencing? Ta
  6. Hi, this is how I enable/disable required tab pages: ' enable required tab pages For intX = 0 To m_objContract.Frequency Me.tbcJobs.TabPages.Item(intX).Enabled = True Next ' disable the rest, but leave summary enabled For intX = m_objContract.Frequency To Me.tbcJobs.TabPages.Count - 2 Me.tbcJobs.TabPages.Item(intX).Enabled = False Next Works a treat? I will read up on UserControl and Hash?
  7. Sorry, Divil just saw you posting.... I'm trying to do something like this For intX = o to UBound(arrDates)-1 Me.Controls(Me.Controls.IndexOf("txtDueDate" & intX)).Text = arrDates(intX,0) Next Obviuosly doesn't work due to String in IndexOf. Why has MS removed the ability to access via name??
  8. OK, here goes... I have a Tab Control with 12 Tab Pages all with the same fields but ending in their Tap Page number, ie txtDueDate1, txtDueDate2 etc. As a user selects a record the data returned will determine how many Tab Pages will be enabled. Once this occurs I need to populate each Tab Page with the data relevant to each due date page. I have been reading in the VB .Net help that the ControlsCollection only allows accessing by index number now which is proving a bind. If for example I have 20 contols on each of the 12 pages I do not want to have to cycle through them like 'for each textbox in controls - if name = '' etc as this will be grossly ineffiecient. Any ideas?
  9. I have a tab control with a selection of textbox controls on each tab page. I am attempting to cycle through each page to assign a value to a textbox on each tap page. If each textbox is named txtDueDate1, txtDueDate2, txtDueDate3 etc how can I cycle through them in a loop? The controls object wants a integer index, I cannot find a way to reference by name. I am going to be stuck completely when I try to assign values to all other controls on each page as the index values are all over the show? HELP.....PLEASE :-(
×
×
  • Create New...