Change VB6 cell properties on runtime? - vb6

I have a table with a foo number of rows and bar number of columns.
What i'd like is for the selected cell to really appear as being selected.
At the moment the leftmost cell gets a red text to mark it's being selected.
What i'd llike is for the lines at the top and bottom of the cell to get bigger to really show that the cell is selected.
I've looked at the following but without success.
grd.row = aRow
grd.col = aCol
' Therafter i try to change the following:
grd.CellBorderColor = 255 ' Original value does not change
grd.CellBorderStyle = 2 ' Original value does not change
EDIT:
I found out that previously named properties are read only.. What can i do?
Any tips and/or pointers in the right direction will be highly appreciated, thanks for reading.

This particular grid. Called vaSpread or fpSpread needs a specific line to execute.
For executing changes to grid style you need to call grid.action = 13 after you've written the visual changes to the grid.

Related

In the Format cells dialog box, under category General, how to remove 0 from the sample box?

When we are pulling values from another sheet, if there is nothing in a particular cell, then it should return the same instead of returning Zero
I tried to remove the zero from sample section. but i doesn't know how to do that

PowerPoint VBA to get selected cell and row and column

I am trying to use VBA and C# to determine the selected range of cells in a PowerPoint table. Ideally, I could use something like the .Start and .End properties of the selected range of cells to identify the row and column boundaries of the selected range of cells, but I could find no such properties.
But I cannot find any way to get the cell coordinates from the selection object. I want to use something like this:
var startColumn = selection.ShapeRange.Table.<selected cellrange>.Start;
The only thing I found that was even close was some code that looped over each cell in the selected table object asking if each cell was selected.
For x = 1 To oTbl.Rows.Count
For y = 1 To oTbl.Columns.Count
If oTbl.Cell(x, y).Selected Then
' do something with the selected cell or indexes
End If
Next
Next
Is that the only way for me to determine the row and column of the selected cell, or is there a shorter way? Thank you.
#Steve Rindsberg confirmed that PowerPoint has no functions for this sort of thing. I used the code shown above to traverse the table cells to find the selected region.

Displaying multiple colors on a single data bar

Okay I am going to try and be as clear as possible with my end goal here so I apologize if it does sound messy. I am trying to display a data bar that has a target of 10 for example. This data bar is displayed in grey. What I'd like to do is on the same data bar have the color green fill up as each target is completed. Here is a rough image of what I would like:
I'm trying to do this in ssrs within a matrix. If anyone could help I would greatly appreciate it or if anyone needs more detail please let me know.
Thanks in advance.
Right click on your column group and insert 'inside group'.
Drag and drop a Data Bar into your new cell.
Choose a stacked bar.
Click on the new chart, so that Chart Data appears.
Add your first value, the one you wish to be, for example, green.
Add a second value, adding the same value as before.
Change the expression on this second value to be 10 - 'Value'

List Control Adds a Space for an Image to Column 0 When Subsequent Columns Have Images

I’ve come across a problem with Windows list controls (I am specifically using MFC, but it looks like it applies to all list controls in the Windows common controls library).
In my specific case, I want to create a list control that has two or more columns. The first column (0) is text-only and is used to allow the user to jump to entries by typing the text in that row. Column two (or three, or four, or whatever) has an image (or an image and text; either way).
This much is all well and good and can be done easily without problem, however the final list control then ends up having a space to the left of the text in column 0 (it may be on the right on an RTL system). This spacer appears to be reserved for an image and I cannot figure out a way to prevent it. (Arranging the specific order of the columns did not change anything.)
Looking around, I found some other people complaining of the same thing, specifically this thread which leads to this thread. The proposed solution does not work because as was stated, simply shrinking the width of column zero merely cuts off the text rather than the image spacer (plus, you then have to prevent and/or process any changes to column widths that the user tries to make).
Does anyone have any ideas of how to fix this bug short of writing a list control from scratch or using one of the too-fancy grid controls on CodeProject/CodeGuru/etc.?
Thanks a lot.
Did you try to change the iIndent member of the LVITEM struct? MSDN says this:
iIndent Version 4.70. Number of image widths to indent the item. A
single indentation equals the width of
an item image. Therefore, the value 1
indents the item by the width of one
image, the value 2 indents by two
images, and so on. Note that this
field is supported only for items.
Attempting to set subitem indentation
will cause the calling function to
fail.
Column 0 is special in a ListView. As soon as you assign a small image list to the ListView, the control expects you to show an image in column 0, so it leaves space for it.
Solutions:
make column 0 zero-width, give it the value you want the user to be able to type. Column 1 becomes your "first" text column. Columns 2+ are for your images. You need full row select style for this to work. Yes, you have to prevent the user from resizing column 0. Yes, that is a pain.
make a column that does have an image to be column 0 and use LVM_SETCOLUMNORDERARRAY to rearrange the display order
owner draw the items.
give column 0 an icon (just to cover all bases)

Dynamics AX 2009 Report: LabelPosition above does not work?

I'm just in the process of changing the SalesInvoice Report. One thing I'm trying to do is show the label of some items not left of the item value but above it instead.
Seems easy enough: just change the LabelPosition (for example from CustInvoiceJour_InvoiceId) setting from "left" to "above" and voila: the label has vanished. It is just shown nowhere at all.
Strange. I would have expected the label to show up, well, above the content. Not to vanish.
Am I missing something (there is no label height to set), or is this functionality broken?
I'm not sure if this functionality is broken. But in generated design, these elements will not show the label if it's set to above:
Prolog
PageHeader
Header
Footer
Epilog
ProgrammableSection
If the item you're trying to change is in one of those, then the label position above will, from my experience, not work.
My tip is to create a new control of the text type and then use the same label that the extended data type for the field uses under the "text" property and then adjust the position so it is positioned above the field you're trying to set a label on.
From what I have noticed for a ProgrammableSection the column name labels are not shown only on the first page of the report. The labels are shown on the next pages.

Resources