Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Adding Pictures To MSFlexGrid


Hi,I want to add pictures (.ico files) to a specific cell in my grid.When I use this code:MSFlexGrid1.Col = xMSFlexGrid1.Row = yMSFlexGrid1.Picture = LoadPicture("image.ico", vbLPSmall, vbLPVGAColor)I receive an Compile Error: Invalid use of property. So, I must be doing something wrong ;-)Question is what and how should I add pictures to my grid?Thanks in advance,Jeroen.




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Pictures In An MSFlexGrid Cell?
What is the correct syntax for putting pictures in MSFlexGrid cells?

Thanks,

Adding 2 Pictures To 1
i have 2 images which i want tojoin to a single picture like this :
http://planet.nana.co.il/pelegkurland/bar.JPG
(the stick and the bar itself are 2 images : the bar is jpg and the stick on it is gif)
how can i do this using vb6?
and how can i position the stick in a place i want it to be over the bar?
thnaksi n advance
peleg

Adding Pictures
hi all,
ia m doing a project security keypad, where i can type in my numbered password and it will show in a text box beside me all the infomation abour myself.

the thing is that i want to be able to add a picture of myself as well can anyone show me how i can complete this task , it would be uch apprepraited.

ronan

Adding 2 Pictures To 1
i have 2 images which i want tojoin to a single picture like this :

(the stick and the bar itself are 2 images : the bar is jpg and the stick on it is gif)
how can i do this using vb6?
and how can i position the stick in a place i want it to be over the bar?
thnaksi n advance
peleg

Adding Pictures?
Hi,
I'm builing a program that should allow the user to add their own say 5 or 6 specific pictures into the program and be displayed, ie let them browse their computer, select a picture and display it in my program when it runs. Any ideas how I would go about this?

Thanks

Adding Pictures
how would i make it so that it adds a picture box with a picture loaded onto the form, without me puttin the box on the form before i run the program?

Adding Pictures To A Form
I have a simple MDI parent form with two child forms. I have established a connection to the database, and when selecting an element from a combo box, all of the relevant textboxes and checkboxes are filled. THe problem I have is that now some elements contain pictures, drawings, and a document.

I have no idea how to incorporate pictures into the code, so that when an element is selected, if a picture or pictures (maximum of 3) is associated they will be displayed in a picture box on the form. As well, some elements have word documents that go with them, and I want there to be an option to be able to access this associated word document from the VB app.

I'm not sure if any of this is possible, but I will post a zipped version of the application in case one of you master coders can help me. THe three elements I want to add are:

- Picture (with a maximum of 3 TIF files displayed in the picturebox array)
- Drawing (just one TIF file displayed in a picture box)
- Method (a word document link).

Thanks to anyone who gives this a shot. Keep in mind I have never added links to pictures before, so please bear with me.

Knoxitis

(I know you're out there Rive )

Adding Pictures To Buttons In VB6
I have a program and I have a few buttons on it like print and open. I would like to add small pictures to the buttons like on the printer button, add a printer picture. Could you show me how to do it? Thanks!!

Adding Pictures In Richtextbox
i've seen Volte-Face tutorial on richtext box and it says to add pictures use

RichTextBox1.OLEObjects.Add , , , "C:My Documents1.gif"

but id doesnt seem to work

Adding Pictures To A Richtextbox?
Is there a way to replace certain text in a rich text box with a picture? I remember seeing a tutorial on planetsourcecode, but they are having problems and all Zip files are gone, so I can't get it.

Adding Map Pictures To List
hi folks,

is it possible to put map picture's in front of a list item ?
or do i have to use a different object?

Adding Pictures Is TOO SLOW
I have a major problem with speed here. I am trying to paint items (Images And Text) onto a form. I am using the PaintPicture method to paint the images on the form and using the DrawText API to draw the text.


If i just use text its fine. But when i load images it litteraly slows down so much that i can see each line being drawn. I know that having to load each image is suppost to be a tad slow but this is just crazy.

Let me fill you in on some code. you can just copy and paste this and run it for the most part. Just add a picture box and a command button.


VB Code:
'In the modulePublic Declare Function SetRect Lib "user32" _                       (lpRect As RECT, _                        ByVal X1 As Long, ByVal Y1 As Long, _                        ByVal X2 As Long, ByVal Y2 As Long) As Long Public Declare Function DrawText Lib "user32" Alias "DrawTextA" _                       (ByVal hdc As Long, _                        ByVal lpStr As String, ByVal nCount As Long, _                        lpRect As RECT, _                        ByVal wFormat As Long) As Long               Public Const DT_CENTER = &H1Public Const DT_LEFT = &H0Public Const DT_RIGHT = &H2Public Const DT_VCENTER = &H4Public Const DT_WORDBREAK = &H10Public Const DT_SINGLELINE = &H20 Public Type RECT            Left As Long            Top As Long            Right As Long            Bottom As LongEnd Type  'In the formDim ItemRct As RECTDim MyArray() As String Private Sub Command1_Click()Static R As Long, B As Long, G As LongR = R + 35B = B + 35Call Additem("SDSDFSDF", R, B, G, "C:windowsDesktopHometown2.jpg")End Sub   Sub Additem(Text As Variant, Fontcolor1 As Long, fontcolor2 As Long, fontcolor3 As Long, Optional ImagePath As String = "")ReDim Preserve MyArray(UBound(MyArray) + 1)MyArray(UBound(MyArray)) = CStr(Text) & "@#$" & Fontcolor1 & "@#$" & fontcolor2 & "@#$" & fontcolor3 & "@#$" & ImagePathStatic index As LongDim IconPic As StdPicture, PicLen As IntegerIf Picture1.TextHeight("Aa") * (UBound(MyArray) - 1) > Picture1.ScaleHeight Then Exit SubPicLen = 20 Picture1.ScaleMode = vbPixelsSet ImagePic = LoadPicture(ImagePath)Picture1.ForeColor = RGB(Fontcolor1, fontcolor2, fontcolor3)Picture1.ScaleMode = vbPixels    SetRect ItemRct, 0, index * Picture1.TextHeight("Aa"), Picture1.Width, Picture1.TextHeight("Aa") + Picture1.TextHeight("Aa")    If ImagePath <> "" Then        SetRect ItemRct, PicLen + 1, index * Picture1.TextHeight("Aa"), ItemRct.Right, index * Picture1.TextHeight("Aa") + Picture1.TextHeight("Aa")       Else       SetRect ItemRct, 0, index * Picture1.TextHeight("Aa"), ItemRct.Right, index * Picture1.TextHeight("Aa") + Picture1.TextHeight("Aa")       End If       DrawText Picture1.hdc, Text, Len(Text), ItemRct, DT_SINGLELINE Or DT_VCENTER          If ImagePath <> "" Then          Picture1.PaintPicture ImagePic, 0, ItemRct.Top, PicLen, Picture1.TextHeight("Aa") - 2          End Ifindex = index + 1End Sub  Private Sub Form_Load()ReDim MyArray(0) As StringEnd Sub Private Sub Picture1_Paint()For i = 0 To UBound(MyArray) - 1a = Split(MyArray(i + 1), "@#$")Static index As LongDim ImagePic As StdPicture, PicLen As Integer PicLen = 20Picture1.ForeColor = RGB(a(1), a(2), a(3))Picture1.ScaleMode = vbPixelsSet ImagePic = LoadPicture(a(4))Picture1.ScaleMode = vbPixels    SetRect ItemRct, 0, i * Picture1.TextHeight("Aa"), Picture1.Width, Picture1.TextHeight("Aa") + Picture1.TextHeight("Aa")        If ImagePath <> 0 Then        SetRect ItemRct, PicLen + 1, i * Picture1.TextHeight("Aa"), ItemRct.Right, i * Picture1.TextHeight("Aa") + Picture1.TextHeight("Aa")       Else       SetRect ItemRct, 0, i * Picture1.TextHeight("Aa"), ItemRct.Right, i * Picture1.TextHeight("Aa") + Picture1.TextHeight("Aa")       End If       DrawText Picture1.hdc, a(0), Len(a(0)), ItemRct, DT_SINGLELINE Or DT_VCENTER          If ImagePath <> 0 Then          Picture1.PaintPicture ImagePic, 0, ItemRct.Top, PicLen, Picture1.TextHeight("Aa") - 2End IfNextEnd Sub


I no comprendeh why this is soooooo slow.. Can anyone clue me in as to a faster way? Or explain why this is so slow?


THANKS!

Adding Pictures To Menus
I am making a program which checks the files present in a directory and then gets its default icons. After that it adds the pictures and the folder/file names to a menu. But the problem i am having is that i am using SetMenuBitmaps api to set the pics but the pics are not in bmp format so its not working. The pictures are drawn at runtime by imagelist_draw api. Can canyone tell me how should i put the pictures on to the menu.

Adding Pictures To A Form
I am in the process of building a mp3 jukebox. I have am using Access as my database. I have a table with a field "photo" with data type set to OLE, which holds a .bmp or .jpg of the album cover. When I use an adodc through VB to cycle though my albums, VB is unable to bind to this field. All other fields are displayed. Anyway to get VB to display this field?

Adding Pictures Using Windowed DX7 Mode
During run-time, how do I load up bmp's and move them around?
(In windowed mode)

I looked at directx4vb.com and I understood the window section except nowhere could I find how to load new pictures DURING run-time. Also, how do I load a new bmp on TOP of a bmp already in a picture box.

The first bmp would be loaded using Blt then the second using bltfast so it doesn't cover the entire first bmp. Except, I have no clue how to load bmps and move them around.

Any help would be greatly appreciated.

PS: If this helps the visualization, I want to do this for a very basic tile-based 2d game. A backround, then a character (32x32) that can move around on the backround.

Adding Bitmap/pictures To Popupmanu
hi, i need a little help. i have this code in my class (below) that makes me a popupmenu, the only thing is i need to be able to put a bitmap/picture into them, so can someone please modify my code of something so i can do that??

thanks


Code:
Option Explicit
Option Compare Text

Public Event ItemClick(ByVal sItemKey As String)

Private Enum enumMenuItemInfoMembers
MIIM_STATE = &H1
MIIM_ID = &H2
MIIM_SUBMENU = &H4
MIIM_CHECKMARKS = &H8
MIIM_TYPE = &H10
MIIM_DATA = &H20
MIIM_STRING = &H40
MIIM_BITMAP = &H80
MIIM_FTYPE = &H100
End Enum

Private Enum enumMenuFlags
MF_APPEND = &H100&
MF_BITMAP = &H4&
MF_BYCOMMAND = &H0&
MF_BYPOSITION = &H400&
MF_CALLBACKS = &H8000000
MF_CHANGE = &H80&
MF_CHECKED = &H8&
MF_CONV = &H40000000
MF_DEFAULT = &H1000 ' #if(WINVER >= 0x0400)
MF_DELETE = &H200&
MF_DISABLED = &H2&
MF_ENABLED = &H0&
MF_END = &H80
MF_ERRORS = &H10000000
MF_GRAYED = &H1&
MF_HELP = &H4000&
MF_HILITE = &H80&
MF_HSZ_INFO = &H1000000
MF_INSERT = &H0&
MF_LINKS = &H20000000
MF_MASK = &HFF000000
MF_MENUBARBREAK = &H20&
MF_MENUBREAK = &H40&
MF_MOUSESELECT = &H8000&
MF_OWNERDRAW = &H100&
MF_POPUP = &H10&
MF_POSTMSGS = &H4000000
MF_REMOVE = &H1000&
MF_RIGHTJUSTIFY = &H4000 ' #if(WINVER >= 0x0400)
MF_SENDMSGS = &H2000000
MF_SEPARATOR = &H800&
MF_STRING = &H0&
MF_SYSMENU = &H2000&
MF_UNCHECKED = &H0&
MF_UNHILITE = &H0&
MF_USECHECKBITMAPS = &H200&
End Enum

Public Enum enumMenuItemTypes
MFT_STRING = MF_STRING
MFT_BITMAP = MF_BITMAP
MFT_MENUBARBREAK = MF_MENUBARBREAK
MFT_MENUBREAK = MF_MENUBREAK
MFT_OWNERDRAW = MF_OWNERDRAW
MFT_RADIOCHECK = &H200
MFT_SEPARATOR = MF_SEPARATOR
MFT_RIGHTORDER = &H2000
MFT_RIGHTJUSTIFY = MF_RIGHTJUSTIFY
End Enum

Public Enum enumMenuItemStates
MFS_GRAYED = &H3
MFS_DISABLED = MFS_GRAYED
MFS_CHECKED = MF_CHECKED
MFS_HILITE = MF_HILITE
MFS_ENABLED = MF_ENABLED
MFS_UNCHECKED = MF_UNCHECKED
MFS_UNHILITE = MF_UNHILITE
MFS_DEFAULT = MF_DEFAULT
MFS_MASK = &H108B ' #if(WINVER >= 0x0500)
MFS_HOTTRACKDRAWN = &H10000000 ' #if(WINVER >= 0x0500)
MFS_CACHEDBMP = &H20000000 ' #if(WINVER >= 0x0500)
MFS_BOTTOMGAPDROP = &H40000000 ' #if(WINVER >= 0x0500)
MFS_TOPGAPDROP = &H80000000 ' #if(WINVER >= 0x0500)
MFS_GAPDROP = &HC0000000 ' #if(WINVER >= 0x0500)
End Enum

Private Enum enumTrackPopupMenu
TPM_CENTERALIGN = &H4
TPM_LEFTALIGN = &H0
TPM_RIGHTALIGN = &H8
TPM_BOTTOMALIGN = &H20
TPM_TOPALIGN = &H0
TPM_VCENTERALIGN = &H10
TPM_NONOTIFY = &H80
TPM_RETURNCMD = &H100
TPM_LEFTBUTTON = &H0
TPM_RIGHTBUTTON = &H2
End Enum

'''Public Enum enumItemTypes
''' eitChecked = MF_CHECKED
''' eitAppend = MF_APPEND
''' eitAlignLeft = TPM_LEFTALIGN
''' eitAlignRight = TPM_RIGHTALIGN
''' eitAlignCenter = TPM_CENTERALIGN
''' eitDisabled = MF_DISABLED
''' eitGrayed = MF_GRAYED
''' eitSeparator = MF_SEPARATOR
''' eitString = MF_STRING
'''End Enum

Private Type POINTAPI
X As Long
Y As Long
End Type

Private Type MENUITEMINFO
cbSize As Long
fMask As enumMenuItemInfoMembers
fType As enumMenuItemTypes
fState As enumMenuItemStates
wID As Long
hSubMenu As Long
hbmpChecked As Long
hbmpUnchecked As Long
dwItemData As Long
dwTypeData As String
cch As Long
End Type

Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type

Private Declare Function GetCursorPos _
Lib "user32" ( _
lpPoint As POINTAPI) _
As Long

Private Declare Function InsertMenuItem _
Lib "user32.dll" _
Alias "InsertMenuItemA" ( _
ByVal hMenu As Long, _
ByVal uItem As Long, _
ByVal fByPosition As Long, _
lpmii As MENUITEMINFO) _
As Long

Private Declare Function CreatePopupMenu _
Lib "user32" () _
As Long

Private Declare Function TrackPopupMenu _
Lib "user32" ( _
ByVal hMenu As Long, _
ByVal wFlags As enumTrackPopupMenu, _
ByVal X As Long, _
ByVal Y As Long, _
ByVal nReserved As Long, _
ByVal hwnd As Long, _
lprc As RECT) _
As Long

Private Declare Function AppendMenu _
Lib "user32" _
Alias "AppendMenuA" ( _
ByVal hMenu As Long, _
ByVal wFlags As Long, _
ByVal wIDNewItem As Long, _
ByVal lpNewItem As Any) _
As Long

Private Declare Function DestroyMenu Lib "user32" ( _
ByVal hMenu As Long) _
As Long



Dim hMenu As Long

Private colHandles As Collection
Private lCurItem As Long


Public Function AddItem( _
ByVal sItemKey As String, _
ByVal sCaption As String, _
Optional ByVal eType As enumMenuItemTypes = MFT_STRING, _
Optional ByVal eState As enumMenuItemStates = MFS_ENABLED, _
Optional ByVal lItemData As Long)

Dim newMenuItem As MENUITEMINFO

lCurItem = lCurItem + 1

With newMenuItem
' The size of this structure.
.cbSize = Len(newMenuItem)
' Which elements of the structure to use.
.fMask = MIIM_STATE Or MIIM_ID Or MIIM_TYPE Or MIIM_DATA
' The type of item: a string.
.fType = eType
' This item is currently enabled and is the default item.
.fState = eState
' Set The ItemData
.dwItemData = lItemData
' Assign this item an item identifier.
.wID = lCurItem
' Display the following text for the item.
.dwTypeData = sCaption
' We would set submenu to the handle of an existing
' popup to bind them together
'.hSubMenu = ??
.cch = Len(.dwTypeData)
End With
Dim lHandle As Long

lHandle = InsertMenuItem(hMenu, lCurItem - 1, 1, newMenuItem)

If lHandle <> 0 Then
colHandles.Add sItemKey, "h" & lCurItem
End If

End Function


Public Function PopupMenu(ByVal lHwnd As Long) ', ByVal X As Single, ByVal Y As Single)

Dim Pt As POINTAPI

GetCursorPos Pt

Dim lItem As Long
Dim rec As RECT
lItem = TrackPopupMenu(hMenu, TPM_NONOTIFY Or TPM_RETURNCMD Or TPM_LEFTALIGN, Pt.X, Pt.Y, 0, lHwnd, rec)
If lItem <> 0 Then
RaiseEvent ItemClick(colHandles(lItem))
End If

End Function

Private Sub Class_Initialize()
hMenu = CreatePopupMenu()
Set colHandles = New Collection

End Sub

Private Sub Class_Terminate()
Set colHandles = Nothing
DestroyMenu hMenu
End Sub

Adding Pictures In Database(Table)?
hi
i want to add to add pictures in database (Access) what thing i can use and
(image ,picture box ,ole) ,what is right choice and how can i use it at run time?
THANKS

Adding Menu Pictures From An Imagelist
I found the API to put an image into a menu from a picturebox but how would I take the image from an imagelist that already has the images I want for a toolbar..


thanks.

Adding Pictures To A Rich TextBox?
I would like to be able to have a Rich TextBox that acts like Yahoo and MSN messenger message boxes. In short I want to be able to replace with a smilie face, with a sad face, etc.

Any ideas?

Adding Pictures/icons To A Listbox
How do I add a picture/icon to a listbox or combobox?
eg.
**********************************
*picture text text text text *
**********************************
*picture text text text text *
**********************************
*picture text text text text *
**********************************

I Have A Problem In Adding Pictures And Text To D
Firstly I want to say : Thank you for this great forum
Secondly I have a problem with database
The problem is : I have a richtextbox which containing pictures and text
But when I want to save the pictures and text to my microsoft access database the program saves the text and ignores the pictures
and when i open the database i find the text without the pictures
can you help me to save it in the database and show it again or it is impossible
I'm using An ((acess)) database so I think that the solution is to locate the pictures in the richtext and to convert the picture to array
But i can't code it
can you code it and solve my problem
if you can plaese help me

Adding Pictures And Other Variables To The Same File
How can I add also these Picture-variables and other variables to a same file. And how can I then take those variables from that file...

Aki.

Problem With Picturebox Adding Pictures From Images
ok, i need to add a picture from a image to a picture box. here is the code i used:
In form with images:

Code:
Dim x1 As Integer
Dim y1 As Integer
Dim w1 As Integer
Dim h1 As Integer
Dim x2 As Integer
Dim y2 As Integer
Dim w2 As Integer
Dim h2 As Integer
Dim x3 As Integer
Dim y3 As Integer
Dim w3 As Integer
Dim h3 As Integer

Private Sub Timer1_Timer()
x1 = (Image1.Top * 4)
y1 = (Image1.Left * 4)
w1 = (Image1.Width * 4)
h1 = (Image1.Height * 4)
x2 = (Image2.Top * 4)
y2 = (Image2.Left * 4)
w2 = (Image2.Width * 4)
h2 = (Image2.Height * 4)
x3 = (Image3.Top * 4)
y3 = (Image3.Left * 4)
w3 = (Image3.Width * 4)
h3 = (Image3.Height * 4)
End Sub
In form with picture box:

Code:
Private Sub Form_Load()
Picture1.PaintPicture Layer1.Image1.Picture, x1, y1, w1, h1
Picture1.PaintPicture Layer1.Image2.Picture, x2, y2, w2, h2
Picture1.PaintPicture Layer1.Image3.Picture, x3, y3, w3, h3
End Sub
Layer1 is the form in which the images are on. Here is the error I get:

Invalid Property Value

Thanks if you help me at all.

EDIT: Just to let you know I am using these variables, incase these images move at all. I am obviously enlarging them to go into the picturebox, but they only enlarge in the picture box, and remain the same in the images. I hope this is all clear.

I Have A Problem In Adding Pictures And Text To Database
Firstly I want to say : Thank you for this great forum
Secondly I have a problem with database
The problem is : I have a richtextbox which containing pictures and text
But when I want to save the pictures and text to my microsoft access database the program saves the text and ignores the pictures
and when i open the database i find the text without the pictures
can you help me to save it in the database and show it again or it is impossible
I'm using An ((acess)) database so I think that the solution is to locate the pictures in the richtext and to convert the picture to array
But i can't code it
can you code it and solve my problem
if you can plaese help me

Adding Pictures To Imagebox From Label Number
hi i am tring to create a little image counter program

and i am not to sure how i can do this without hard coding in a picture for each number as there is going to be a lot of numbers

i have 10 image boxes and a label my label reads from a text file to find the initial number then it increments by 1 on form load then it rewrites back to the file a new number this i have done and works fine.

the thing i need to know is how i can assign my image boxes an image each time the label increments without hard coding

(ie. if label.caption = 1 then load picture)this i dont want to do

can you help me please
thanks

I Have A Problem In Adding Pictures And Text To Database
Firstly I want to say : Thank you for this great forum
Secondly I have a problem with database
The problem is : I have a richtextbox which containing pictures and text
But when I want to save the pictures and text to my microsoft access database the program saves the text and ignores the pictures
and when i open the database i find the text without the pictures
can you help me to save it in the database and show it again or it is impossible
I'm using An ((acess)) database so I think that the solution is to locate the pictures in the richtext and to convert the picture to array
But i can't code it
can you code it and solve my problem
if you can plaese help me

Adding Pictures To An Image List At Runtime (vb6)
ok i have a toolbar, an empty image list and a function that will get an icon from an exe. i'm trying to take the icon from an exe file and place it in the imagelist so it will appear in the toolbar. this is what i have...


Code:


indexNum = 1

ToolbarForm.ToolbarIcons.ListImages.Add.Index = indexNum
ToolbarForm.ToolbarIcons.ImageHeight = 32
ToolbarForm.ToolbarIcons.ImageWidth = 32

Set ToolbarForm.ToolbarIcons.ListImages.Add.Picture = GetIconFromFile(app.exe, 0, True)



i get this error message:
Quote:
Run-time error '35607':
Required argument is missing.

and when i click 'Debug' it's on the line:

Code:


ToolbarForm.ToolbarIcons.ListImages.Add.Index = indexNum



can anyone help?
-Dustin

Adding Icons/Pictures To Menu Items
Hi,
In VB or VB.Net I used menus in the forms but I never found any option to add an icon or picture to menu item as can be seen in Microsoft office and Visual Studio application's main menu. Please help!

I Have A Problem In Adding Pictures And Text To Database
Firstly I want to say : Thank you for this great forum
Secondly I have a problem with database
The problem is : I have a richtextbox which containing pictures and text
But when I want to save the pictures and text to my microsoft access database the program saves the text and ignores the pictures
and when i open the database i find the text without the pictures
can you help me to save it in the database and show it again or it is impossible
I'm using An ((acess)) database so I think that the solution is to locate the pictures in the richtext and to convert the picture to array
But i can't code it
can you code it and solve my problem
if you can plaese help me

Resource File, Adding Jpeg Or Standard Pictures?
Can you put jpeg, or standard picture formats in the resource file so you could use to view pictures instead of having to have the pictures seperate? What I mean is the pictures would compile into the .exe file. Can this be done and how?

Adding Pictures To Image Control In DataReport At Runtime???
Does anyone have any clue how to add pictures to an image control in the DataReport at runtime. I can add one all day long at design time but I want to be able to add them at runtime.

Any help or advice would greatly help me out.

Thanks in advance,
Noble


================================================
Noble D. Bell
Owner
www.noblesoftware.com

Adding To MSFlexGrid
I'm not sure I'm using the right control here, but here is what I would like to accomplish. I would like to populate a control so that has many rows with possibly 5 columns.
Col1 - Col2
ROW1 - Bob - Smith
ROW2 - John - Jackson
ROW3 - Jill - Titan
ROW4 - Molly - Nichols

However with the MSFlexGrid, I seem able to only add rows to the grid. I can't seem a way to figure out how to access any row,column combination. Whether it be to add or edit.

Example:
changing row 1, column 2 from Bob to Bobby

Adding To Msflexgrid
Hi all;

I am using visual basic 6, i want to add datas to my msflexgrid. i am using:


Code:
datagrid.Row = 1
datagrid.Col = 1
datagrid.Text = "Something"


is there another way of adding to msflexgrid like :


Code:
datagrid.addItem


Becouse i have a form and when the form is filled i would like to add informations to the flexgrid. if i use the first one i should repeatedly specify the cols and rows. Please help with with this problem.

Thank You.

MSFlexgrid: Adding A Row
I somehow managed to name the columns by doing this:

-------------------------------------------------------------------------------------------
With fgSample 'fgSample is my flexgrid

.TextMatrix(0, 1) = "Product"
.TextMatrix(0, 2) = "Lot#"
.TextMatrix(0, 3) = "Quantity"

End With
-------------------------------------------------------------------------------------------

Is this the right way?

My concern is that, later on, I would like to use my columns as references to make it possible to be accessed to my local database.

One more question:

When a user choose one of the products from "Product" combobox, the "Lot#" combobox should only be populated with options which the certain Product has. User can not choose a Lot# before choosing a Product.

Right now, mine does not do that. (Basically, right now, when I choose a product, I can choose any of the lot#s, which is not right. Also, even worse, I can even choose my lot number first...)

I hope I explained it well enough.

I am in desperation.... Somebody Rescue me, PLZ!!!

Adding MsFlexGrid To The Toolbox In VB.net
Hi
Can anybody help exaplining me how to add Ms.FlexGrid to the form on my project in Vb.net.

Also, if somebody has sample code to demonstarate use of datagrid, it will be appreciated

Thanks and Regards,
Ravi

MSFlexGrid: Adding Components
hi i want to be able to implement a date picker, an option box, and a checkbox components into cells in the MSFlexgrid, is this possible? if so, how?

Msflexgrid Adding Data To The Col
Hello
I am having trouble adding to the col 1,2,3,4
I can add to the first row using msfexgrid1.additem test1.test
Now i need to add test3,test4,test5.text to diffrem col.
Please if you can help me.

Adding Data From Db To Msflexgrid
Here is my code to populate a MSFlexGrid from my database. I only get the first record with my code. Could someone tell me why this is happening?

Code:
Dim i As Integer
Dim oConn As ADODB.Connection
Dim MyRecSet As ADODB.Recordset

Set oConn = New ADODB.Connection
oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & App.Path & "Employeedb.mdb;"

Set MyRecSet = oConn.Execute("SELECT Salary, EName, ShiftStart, ShiftEnd, PTOYear, PTODay, UName, Password FROM EData")

With ShiftGrid
For i = 1 To .Rows - 1
.TextMatrix(i, 0) = MyRecSet.Fields("Salary")
.TextMatrix(i, 1) = MyRecSet.Fields("EName")
.TextMatrix(i, 2) = MyRecSet.Fields("ShiftStart")
.TextMatrix(i, 3) = MyRecSet.Fields("ShiftEnd")
.TextMatrix(i, 4) = MyRecSet.Fields("PTOYear")
.TextMatrix(i, 5) = MyRecSet.Fields("PTODay")
.TextMatrix(i, 6) = MyRecSet.Fields("UName")
.TextMatrix(i, 7) = MyRecSet.Fields("Password")
Next i
End With
oConn.Close

Adding Rows To An MSFlexgrid
Hi guys, I know how to add rows to the MSFlexgrid. But how do I do it like it is done in Excel. Like if I have a row highlighted or right-click and say add new row a new row should be added at that position.

Please help.

Adding Subitems To MsFlexgrid?
i searched pscode and i found one example, but it's kinda hard to understand. i also search this fourm, and it doesnt seem like anyone has asked this question before, so i'll ask...

how do you add subitems to msflexgrid? i can only add one item, and if i try to add another one, it goes to the next line. what i want is to add subitems.

Adding Cmd Buttons To MSFlexgrid??
Has anyone ever been able to add a cmd button to a cell in an MSFlexgrid and have it "act" as a command button??

Adding A Record At The Top Of Msflexgrid
Hello vb guru, i have a problem with my project. flexgrid seems to be very slow in loading big pile of recordset. and my records seems to add 10 per secs. so instead loading all recordset over and over again. i just like to add the new ones. but i need the new ones to be added at the top of flex grid. so my question is:

how can i add records at the top of msflexgrid. i already have existing records in flexgrid and i need to add new records at the top....


thanks in advance

MSFlexGrid Adding Values In Cells
In the leavecell event of my MSFlexgrid I want to check that the total of two cells is not greater than 100 if it is then I want to cancel the change.

Say for instance i'm leaving column two of the row I want to check that the sum of column two and column three is less than/equal to 100. I'm editing cells with a dynamic text box, but is it necessary to move to the column everytime. Can I get the value of the textmatrix for the next cell without moving to it?

Private Sub MSflexemission_LeaveCell()
' Assign textbox value to grid
Dim TotalPercent
TotalPercent = Me.txtDataEntry ' total percent now is value of current cell
If Me.txtDataEntry.text <> "" Then
If Me.MSFlexEmission.Col > 1 Then
If CLng(txtDataEntry.text) > 100 Then ' disallows entries > 100
Beep
Me.txtDataEntry.text = ""
End If
End If
End If
' here I need to add data in adjacent column to TotalPercent and verify that it's not > 100
Call SaveEdits
End Sub

thanks for looking at my question

Howler

MSFlexGrid Adding To Database In A Loop
OK my below code isnt working it is supposed to let me add all the rows from the MSflexgrid to access database. Their is not a set number of rows it can varry hence tring to loop it.


Private Sub cmdCheckout_Click()

'This will
Dim OrderID As Double
'Using the Rnd will generate a number between 1000000000 & 9999999999
OrderID = Year(Date) & Month(Date) & Day(Date) & Left$(Time$, 2) & Mid$(Time$, 4, 2) & Right$(Time$, 2)

Dim cnn As ADODB.Connection
Dim rs As ADODB.Recordset
Dim sQuery As String

Dim lCol2 As Long
Dim lRow2 As Long

sQuery = "Select * FROM [Order]"

Set cnn = New ADODB.Connection
Set rs = New ADODB.Recordset

cnn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "data.mdb" & ";Persist Security Info=False"

cnn.Open

rs.Open sQuery, cnn, adOpenKeyset, adLockOptimistic, adCmdText

With rs
.AddNew

'This will add data to database under relevant fields
.Fields("ID") = VarCustomer
.Fields("Order_ID") = OrderID

With MSFlexGrid1
For lRow2 = .FixedRows To .Rows - 1 ' Process all row
MSFlexGrid1.TextMatrix(1, lRow2) = .Fields("Product ID").Value
Next lRow2
End With

.Update

End With

End Sub

Adding Values In 1 Cell Of MSFlexgrid
Following on from my previous question which was thankfully solved by you guys Its led me on to one final query!

I now retrieve figures into a cell of MSFlexgrid, sometimes these cells contain 2,3 or 4 lines in each cell.

Is there a way to add the figures from a single cell in msflexgrid which has figures seperated by a line drop.

For example Cellmatrix 1,1 in msflexgrid contains the following information with multiline :-

12
300
24

I need to write something which detects each of those figures in that single cell and adds each line together, as currently my column calculation function thinks this cell is valued at 1,230,024 when it should be 12+300+24. thanks!

Hope someone could help, or maybe its impossible?

Adding Graphics To MSFlexGrid Cell
Hello,

Is there a way to add an icon in front of text in MSFlexGrid's columns?

Adding Multiple Values To A MSFlexGrid Cell
I have a user form with a number of input boxes i.e. text, listboxes etc. also have a MSflexGrid. I want to join all data entered into my inpot boxes (approx 6 boxes) then add them to a single cell in the flexgrid and finally wrap and resize the boxes so that the text is displayed.

I am making a pigs ear of it, and certain my approach is not the correct one. My first problem is that I have created a text box to join all the values with a space between each, this is fine apart from the time values (these come from a DTPicker control) I keep getting an error message; 'runtime error 13, type mismatch' I have tried using .Text in place of .Value but still doesn't work.

Note; my JoinedText box will already have a number in it to which I want to add the joined text.

my code is as follows;

Private Sub JoinedText_Click()
JoinedText.Text = JoinedText.Text + " " + AddEvent.Text + " " + Location.Text + " " + StartTime.Value + "-" + EndTime.Value
txtCell.Text = JoinedText.Text
End Sub


Secondly, I have 8 Columns in my flexi grid, and want the value above to be placed in the first empty flexgrid cell, the next record to go into the 2nd flexgridcell and so on until all 8 cells are populated. I haven't a clue how to do this, I have managed to get the text into my flexgrid, but it goes in the last cell (column 8) and not the first;

Private Sub txtCell_Change()
MSFlexGrid1.Text = txtCell.Text

End Sub

What is the easiest way to achieve this?

Any advice/help would be greatly appreciated

Adding And Deleting A Record In MSFLEXGRID Without Database Connection
i'm using vb6. i want to add or delete a record from MSflexgrid without binding it to any datasource.
hope you guys could help.



Edited by - pelipe_H on 1/20/2005 11:24:08 AM

MSFlexGrid - Adding Column Borders Without Merging Columns?
First post, so please be merciful

Background:
I'm upgrading a VB3 application to VB6. The old VB6 application contained a TrueGrid that that displays Phone numbers and contact details. I've replaced the TrueGrid with a VB6 MSFlexGrid. Double-clicking on any row in the MSFlexGrid will open a new child form that displays individual contact details.

To emulate the "look and feel" of the old TrueGrid in the new MSFlexGrid, my Project Manager insists that the new MSFlexGrid must have column lines.
Eg:

| | | |
| | | |
| | | |
| | | |
| | | |

Except that it's virtually impossible to add only column lines to an MSFlexGrid. I need to be able to select individual cells, so using ColumnMerge isn't an option.

Does anyone have any suggestions on how to fix this? My Project Manager won't sign off on the app unless this problem is fixed.

Copyright 2005-08 www.BigResource.com, All rights reserved