Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Basic Flexgrid (add pictures and text)

  • 06-04-2006 3:49pm
    #1
    Registered Users, Registered Users 2 Posts: 7,123 ✭✭✭


    I have finished my project now just have to add pictures and some text to the project using flexgrid.

    The code I am using is this

    Private Sub AxMSFlexGrid1_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AxMSFlexGrid1.Enter
    AxMSFlexGrid1.Row = 1
    AxMSFlexGrid1.Col = 1
    AxMSHFlexGrid1.CellPicture = LoadPicture (c:\Documents and Settings\USER\Desktop\fox_logo1.jpg")

    I am getting a coupple of errors like syntax error and c is not declared?
    This is simple enough but I cant do it any help please. Looked on net but no I got no answer.

    Gob smacked


Comments

  • Registered Users, Registered Users 2 Posts: 32,136 ✭✭✭✭is_that_so


    ("c:\Documents and Settings\USER\Desktop\fox_logo1.jpg")
    Missing a double quote here. It is Some time since I did any VB so I can offer little else.


  • Registered Users, Registered Users 2 Posts: 7,123 ✭✭✭the whole year inn


    did that and now I get LoadPicture is not declared.

    Thanks by the way

    james


  • Registered Users, Registered Users 2 Posts: 32,136 ✭✭✭✭is_that_so


    Got the book out and did a search .
    Are you adding a picture? if so the following may help.


    Private Sub Form_Click ()
    ' Load the icons.
    MSHFlexGrid1.Row =1
    MSHFlexGrid1.Col =1
    Set MSHFlexGrid1.CellPicture =_
    LoadPicture("Icons\Computer\Trash02a.ico")
    MSHFlexGrid1.Row =1
    MSHFlexGrid1.Col =2
    Set MSHFlexGrid1.CellPicture =_
    LoadPicture("Icons\Computer\Trash02b.ico")
    End Sub

    the Link


  • Registered Users, Registered Users 2 Posts: 7,123 ✭✭✭the whole year inn


    Still get the error loadpicture need to be declared, Am i missing something on the form thanks for the help

    james


  • Closed Accounts Posts: 8,866 ✭✭✭Adam


    I dont know the language at all but I imagine the pictures have to be in the same directory or a sub folder as the scripts, as in is_that_so's example...

    EDIT: for example if your scripts are in c:\server\sitename then the pictures must be in 'sitename' or some sub folder, i.e. sitename\pics


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 32,136 ✭✭✭✭is_that_so


    It also appears that declaring the picture variable private on a form and not a subroutine is the way to do it. In your example they appear private to the routine. This would explain why the form "can't see" the pictures. Try using this search loadpicture must be declared


  • Registered Users, Registered Users 2 Posts: 7,123 ✭✭✭the whole year inn


    Got it to work fixed something in the properties. but its not stickin to its column. the code I have is


    Private Sub grdtwo_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles grdtwo.Enter
    grdtwo.Row = 1
    grdtwo.Col = 1
    grdtwo.CellBackColor = System.Drawing.Color.White
    grdtwo.set_ColWidth(2, (Piclogo.Width) * 100.5)
    grdtwo.set_RowHeight(4, (Piclogo.Height) * 60.5)
    grdtwo.CellPicture = System.Drawing.Image.FromFile("C:\Documents and Settings\USER\Desktop\flexgrid\jts-logo.gif")

    End Sub

    I can see the picture but its not in its colum?

    james


  • Registered Users, Registered Users 2 Posts: 7,123 ✭✭✭the whole year inn


    Got it to work fixed something in the properties. but its not stickin to its column. the code I have is


    Private Sub grdtwo_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles grdtwo.Enter
    grdtwo.Row = 1
    grdtwo.Col = 1
    grdtwo.CellBackColor = System.Drawing.Color.White
    grdtwo.set_ColWidth(2, (Piclogo.Width) * 100.5)
    grdtwo.set_RowHeight(4, (Piclogo.Height) * 60.5)
    grdtwo.CellPicture = System.Drawing.Image.FromFile("C:\Documents and Settings\USER\Desktop\flexgrid\jts-logo.gif")

    End Sub

    I can see the picture but its not in its colum?

    james


Advertisement