What is this VB.Net script and how do I add coloring to its cells? - vb.net

I am given a task where I have this VB.Net script that produces and populates a grid and I must add coloring to each grid cell.
Problem is that this freeware given to me is 5 years old and I don't know what the name of this freeware is; I was only given the source files.
I am not entirely sure of how this script works because I am a C# person so I was hoping someone on here might know the freeware's name or what its functionality is so they can explain it to me.
There seem to be 4 files in the freeware folder and below is their screenshot:
I am currently sitting and trying to understand the code for PrintDGV.vb which might or might not be useful in understanding the freeware.
I am not familiar with any of these files but here is the code for PrintDGV.vb

Looks fairly straight forward.
You pass your DataGridView control to it and it looks like it will handle the printing for you:
Call PrintDGV.Print_DataGridView(YourDataGridViewControl)
It's a shared function so you don't need to instantiate it. For coloring your cells, just set the backcolor of your grid cells and it looks like it will use that in the printing process.
To change a color of an individual cell in the DataGridView control:
YourDataGridViewControl.CurrentCell.Style.BackColor = Color.Red

Related

Excel show sheet inside scrollable square

A client is asking me what I think should be done with .NET Windows Forms or similar, but maybe it's possible to do in Excel:
I already added some buttons and actions in a data sheet, but instead of showing all cells as shown by default by Excel, he wants the sheet to be inside an scrollable area. Something like this:
Is this possible? In case it's not clear enough, the scrollbars are just around the data rows and columns, not about the buttons and form items around the actual data
EIDT: I'll try to be more clear, I need all my Excel sheet and workspace to look like a Windows forms application, and the actual data (all the Excel cells) to be inside an scrollable area. I think it's not easy to understand because it's quite weird, as I sayed is my client who wants this.
BTW it wasn't a trial version, I payed for the wireframe software
You could put the buttons in the top row(s) and use the Freeze Pane option
https://support.office.com/en-us/article/freeze-or-lock-rows-and-columns-3439cfe6-010c-4d2d-a3c9-d0e8ba62d724?ui=en-US&rs=en-US&ad=US

vba updateable shape controls in master shape

I am having a bear of a time finding an answer to what seems like a simple question. I am using Visio 2010. I need to have something like text box that I can update through VBA. I have to code to do it
shape.CellsU("Prop.Memory").Formula = """256 MB"""
for example (shape is a variable in this case). The problem is that I can't find out how to tie a control, like a text box or label, to a user defined property like "Prop.memory" in this case. I thought it might be a data graphic but adding a data graphic is disabled for me.
Michael.
I think that I have a solution. It is an odd one but it might work. The problem is that you cannot apply Data graphics when you have the master open in edit mode. what you can do is drop the master on the sheet based on the recordset. now you can add data graphics because it has a record source (I am guessing). I made the changes I need to that layout that I needed. I then dragged that shape to the stencil to become a new master. it will maintain the data links. it seems like an odd way to go about it but it does work. I might be good for now.
update: this didn't work for what I needed. I did find the way, though, on this site: Creating custom Visio shapes
Once you create the shape with the right fields, you have to use something like the following code to update it via VBA:
shp.cells("prop.Memory").Formula= chr(34) & "256 MB" & chr(34)
where shp is a visio shape
I just wanted to be the solution that I found is out there.
Cheers, Michael.

How to create ListBox with code only?

I googled a lot but I had absolutely no luck finding anything about my problem.
I would like to create ListBox - just like the one anyone can create using UserForms. The problem is that I do not want to draw it but write it with a code. I know how to add values to ListBox etc. The only thing I am missing is how to create it programatically.
I found this: Creating form programmatically in the module using vba but this code didn't work for me. It stops at declaring Forms.
The idea behind this ListBox is to create a ListBox to choose from sheets in a workbook to later do some stuff.
Me.Controls.Add ("Forms.Listbox.1")
allows you to add a control at runtime only using an event procedure.

How to Make Exception Handling on VBA Excel Form Combobox?

I have this userform that i'm developing for my report formatting task. My whole code is finished, there are only 2 problems that i need to work on.
Making my VBA application work on every excel file that user choose
Exception Handling for ComboBoxes on my form.
(Edit: I hope trying to get attention of people who are interested in this question to another stackoverflow.com topic is not against forum rules)
You guys can reach first problem's topic from here: (There is already one suggestion but i'm little bit confused. So it would be super for alternative suggestions) http://bit.ly/VnF3cK
And about my second problem, when i click empty place of combobox, i can type whatever i want, but i want to restrict it, so users can only choose values [1-5] that i put inside of combobox. How can I achieve this?
In answer to your secondary question, you need to change the ComboBox's Style property to frmStyleDropDownList

ReportViewer: two text colors, one cell

Is it possible to have 2 areas of text in one cell such that each can have a different color? You can do this in crystal reports but I cannot see a way to do this in ReportViewer. What it is doing is essentially highlighting an important text fragment if it appears in a cell description to draw the users attention. I am fairly new to reportviewer so it for now I am assuming it's my lack of knowledge that is making this difficult. I am using VS2010.
Thanks.
Turns out VicarlnATutu wasn't quite right.
You can do this, but only if you are using VS2010 (which I am) because it includes the new SSRS rendering engine for SQL-Server 2008. This allows you to put some basic HTML into a field and have multiple formats in one cell. For more info see below:
http://msdn.microsoft.com/en-us/library/cc645967.aspx
http://msdn.microsoft.com/en-us/library/cc627491.aspx
One thing that tripped me up is what they call a 'placeholder' in the MS documentation is the little bit of text inside the textbox control that shows up by default. You can select two different things on the control in VS2010. One is the textbox itself. Right clicking on the textbox gives you 'text box properties'. The other thing you can select is the default text INSIDE the textbox. Right clicking on this 'placeholder' text gives you a different context menu where you can select 'placeholder properties'. This is where you can change the cell to accept HTML.
No, unfortunately not. I don't know if there are custom controls out there for ReportViewer, but the built-in TextBox only supports setting color (be it Foreground or Background) for the entire thing.
ah, good to know. kind of a unintuitive way to tell a TextBox to display HTML, but nice to know that you can!