DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Page 2 of 4 FirstFirst 1234 LastLast
Results 16 to 30 of 50

Thread: How to export data from forms to *.txt file

  1. #16
    Join Date
    Jul 2005
    Posts
    50

    Question

    If the the file does not exist then, it would create the file, but if the file does exist, then it would over-write the file.

    I tried to put something like "Print #iFB, text1.text, text2.text", but I am not very sure, because an error came up. Maybe you have to to give "text2.text" a whole different ID though. How are you supposed to know what line "text1.text" was assighned to (if) "text1.text" was assighned to a specific line?


  2. #17
    Join Date
    Nov 2003
    Location
    Portland, OR
    Posts
    8,387
    I don't understand your question. Try this:

    Print #iFB, text1.text
    Print #iFB, text2.text

    Then open the c:\q3config.cfg file in Notepad and see what was written. Does that help?
    Phil Weber
    http://www.philweber.com

    Please post questions to the forums, where others may benefit.
    I do not offer free assistance by e-mail. Thank you!

  3. #18
    Join Date
    Jul 2005
    Posts
    50

    Lightbulb

    YES!!!!!! Thank You Very Much!!!!!!
    I got It!!!
    and I learned allot in the process.
    thank you.

    Also,
    How would you make an item in a listbox be transfered to a single textbox by double clicking it?
    Last edited by thphaca; 07-18-2005 at 06:16 PM.

  4. #19
    Join Date
    Nov 2003
    Location
    Portland, OR
    Posts
    8,387
    In VB's form designer, double-click on your listbox control. A code window will open to a procedure call Sub List1_Click. That's the code that runs when the user single-clicks on the listbox; you want to create a procedure that will run when the user double-clicks. Notice the two dropdowns at the top of the code window: the list on the left contains a list of controls (List1 should be selected); the list on the right contains a list of events for that control. Select the DblClick event from the right-hand list; this will create a List1_DblClick event procedure.

    Finally, add the following code to the List1_DblClick procedure:

    text1.Text = List1.List(List1.ListIndex)

    To understand what that code does, look up the List and ListIndex properties in VB's online help.
    Phil Weber
    http://www.philweber.com

    Please post questions to the forums, where others may benefit.
    I do not offer free assistance by e-mail. Thank you!

  5. #20
    Join Date
    Jul 2005
    Posts
    50

    I Tried...

    That is exacly what I tried at the begining, but what I want it to do in only insert the text in the textbox, and not over-write what is already in it.

  6. #21
    Join Date
    Nov 2003
    Location
    Portland, OR
    Posts
    8,387
    Ah, OK. In that case, try this:

    text1.SelStart = Len(text1.Text)
    text1.SelText = List1.List(List1.ListIndex)
    Phil Weber
    http://www.philweber.com

    Please post questions to the forums, where others may benefit.
    I do not offer free assistance by e-mail. Thank you!

  7. #22
    Join Date
    Jul 2005
    Posts
    50

    Talking

    Thank you once again, but would it be possible to make it so that each time that i double click the item, it also makes a return instead of where the cursor last was? Just to make it more user-freindly.

  8. #23
    Join Date
    Jul 2005
    Posts
    50
    OH! Nevermind! It was just that I had multiline off.
    You Are The Greatest!!!

  9. #24
    Join Date
    Jul 2005
    Posts
    50

    Thumbs up "About"

    How can I make it so that when i click a command button, a dialog window comes up saying the "about" Info?



    And, also, this is not very important, but how do I actually put objects inside specific tabs, with tabbed dialog?
    Last edited by thphaca; 07-18-2005 at 07:34 PM.

  10. #25
    Join Date
    Jul 2005
    Posts
    19
    about the popup use msgbox "About.....",vbInformation,"samplecode"

    tabbed dialog??? hmm do u mean the "Tab Strip"?? if it is then its in the properties just rightclick on the tabstrip then press tabs or use this sample function to add tabs...

    Private Sub Form_Load()
    TabStrip1.Tabs(1) = "hello"
    TabStrip1.Tabs.Add 2, , "Hello2"
    End Sub

  11. #26
    Join Date
    Jul 2005
    Posts
    50

    Question Tabbed Strips?

    Thanks for the "about" popup. But, how do you put stuff inside the tabbed strips?

  12. #27
    Join Date
    Feb 2004
    Location
    Colton, CA
    Posts
    550
    Quote Originally Posted by thphaca
    Thanks for the "about" popup. But, how do you put stuff inside the tabbed strips?
    If you're using SSTab, add the control to the form then select 'properties' by right clicking. Now add tabs in as you wish. You are then creating an array of tabs. To add a control to a tab, select it in design view and just drop controls on as if it were a form.

    If you're using the normal tab strip control, you'd be better off making a frame for each tab (and make them invisible). Then when the user changes tab, a different frame becomes visible.

    If you need more help or explanation, let us know.

    P.S. When I was 12, I was playing NES games and playing in the street. Fair play to you for starting early, as long as you understand the code

  13. #28
    Join Date
    Jul 2005
    Posts
    19
    Quote Originally Posted by thphaca
    Thanks for the "about" popup. But, how do you put stuff inside the tabbed strips?
    when you put something inside the tabstrip use frames, picturebox or other similar types... using the tabstip is like performing magic trick here's a tip whenever a user click on the tab make the object move its position where i can't be seen or better yet hide it from the user... and vice versa here's a sample code...

    Private Sub TabStrip1_Click()
    If TabStrip1.SelectedItem.Index = "1" Then
    Picture1.Visible = True
    Picture2.Visible = False
    Else
    Picture1.Visible = False
    Picture2.Visible = True
    End If
    End Sub

    hope you got this one...

  14. #29
    Join Date
    Jul 2005
    Posts
    50

    Lightbulb

    That is exactly what I thought! That when you click a tab, then it makes the contents of the tab appear and disappear to simulate actual tabs!

    Thanks jj.
    And also, thanks for the words of wisdom, RH.

    Thank You All Very Much For Giving Me So Much Reference!
    Last edited by thphaca; 07-20-2005 at 02:27 AM.

  15. #30
    Join Date
    Jul 2005
    Posts
    50
    Wait! I am very sorry for waisting your time jj and RH, i didnt know that all i had to do was click the tab that i wanted to put something in, and put it in there! I didnt even need that code. But thanks anyway for telling me the method that the program uses to simulate tabs. At least I learned that, and learning is never a waste of time.

    My goal is to be as rich and skilled as Bill Gates!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center