Results 1 to 8 of 8
  1. #1
    charly.csh is offline Competent Performer
    Windows 8 Access 2007
    Join Date
    Nov 2014
    Posts
    186

    Treeview font size


    Hello everyone

    Is there a way to change the font size into a Treeview in access?

    Thanks for the help!!

  2. #2
    vicsaccess's Avatar
    vicsaccess is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Apr 2015
    Posts
    451
    you had me curious so i had to do a quick google search and found this code if that helps
    http://www.vbforums.com/showthread.p...ent-Node-Color
    looks like there is a spot to set the font size

  3. #3
    charly.csh is offline Competent Performer
    Windows 8 Access 2007
    Join Date
    Nov 2014
    Posts
    186
    Don't you have this part of the code available?, I cannot open this website

    In fact looking for the properties into my VB code just I could set the color, but not the font size

  4. #4
    amrut is offline Expert
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2012
    Location
    Dubai
    Posts
    614
    This should work -
    Code:
    Me.YourTreeViewControlName.Font.Size=15

  5. #5
    charly.csh is offline Competent Performer
    Windows 8 Access 2007
    Join Date
    Nov 2014
    Posts
    186
    Wow it worked!!!

    Thank you!!!

    just curious..... If I would like also the font to Arial how should it be stated?

    Me.Treeview.Font. (?) = Arial ??

  6. #6
    vicsaccess's Avatar
    vicsaccess is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Apr 2015
    Posts
    451
    charly.csh, i'm glad that amrut was able to help, my main reason for adding to your post was as i said curiosity and to give your post a bump so that maybe my curiosity could betaken care of. I've actually been ask to do something like this but until your post did not think it was possible with access. if you get a chance to view that link it looks pretty good, but very in-depth. do you have a copy of your code that you could post or maybe a sample DB that i could look at?

  7. #7
    amrut is offline Expert
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2012
    Location
    Dubai
    Posts
    614
    Glad to help.You are on right track.
    Code:
    Me.Treeview.Font.Name = "Arial"
    Search this forum for SmileyCoder or follow SmileyCoder on Youtube.
    He has very good tutorials for Treeview. He helped me too.
    https://www.accessforums.net/showthread.php?t=48400

  8. #8
    charly.csh is offline Competent Performer
    Windows 8 Access 2007
    Join Date
    Nov 2014
    Posts
    186
    Sure vicaccess

    Glad also to help, in fact I stated the code since the begining of load

    ************************************************** ***************+

    Private Sub Form_Load()


    'Call loadTreeview
    Me.TreeReqs.Font.Size = 10
    Me.TreeReqs.Font.Name = "Arial"


    End Sub

    ************************************************** *********
    The property for color I added into an event in my form to change the color depending of the type of node

    Private Sub addChildren(tv As TreeView, nodParent As Node, rsReqs As DAO.Recordset, lngParentID As Long)


    Dim strFind As String
    strFind = "ID_Parent=" & lngParentID
    rsReqs.FindFirst strFind
    Dim nodX As Node
    Dim strBook As String
    Do While Not rsReqs.NoMatch


    Set nodX = tv.Nodes.Add(nodParent, tvwChild, genReqNodeID(rsReqs!PK_Req), rsReqs!mem_Req)


    '*************SELECT CASE FOR COLOR********************




    Select Case rsReqs!ID_Type


    Case 1 'Document
    nodX.Image = "Document"


    Case 2 'Header


    nodX.Bold = True
    nodX.Image = "Header"


    Case 3 'Requirement
    nodX.Image = "Requirement"




    Case 4 'Guide


    nodX.ForeColor = vbBlue
    nodX.Image = "Guide"


    End Select


    '************************************************* *********************************


    strBook = rsReqs.Bookmark
    addChildren tv, nodX, rsReqs, rsReqs!PK_Req
    rsReqs.Bookmark = strBook
    rsReqs.FindNext strFind


    Loop




    End Sub
    *****************************

    I hope this part help


    In fact the main idea I got from a 6 videos series in youtube

    https://www.youtube.com/watch?v=M5Kq...1l-vaOPGz3BLR8

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Changing Font Color and Size in table
    By FormerJarHead in forum Access
    Replies: 2
    Last Post: 01-09-2013, 01:04 PM
  2. MsgBox font size
    By GraeagleBill in forum Programming
    Replies: 4
    Last Post: 01-02-2013, 02:59 PM
  3. Replies: 0
    Last Post: 03-10-2012, 11:35 PM
  4. Font Size control
    By techexpressinc in forum Forms
    Replies: 2
    Last Post: 06-29-2011, 06:26 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums