|
I've asked this before, but just in case it was missed, I thought I'd ask again.
"I want to emphasize the relationship of some adjacent Cell Rows in a Column, by Drawing a 2 or 3 Pixel Line around the Group of Cells.
I read that the Microsoft DataGridView Control does not support the Individual Cell Border Style in the Current Version.
Does anyone have a routine, or suggestions that will achieve this result with the MS DataGridView Control."
Regards, Graham
|
|
|
|
|
You could use the OnPaintCell event to give them a common background colour.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Thank you Henry.
If I'd wanted to know about BackColor I would have asked that question.
The question was about Drawing a line!
Regards, Graham
|
|
|
|
|
You also asked for other suggestions.
I made one.
Sorry you didn't like it, but there was no need for you to respond, if that was the case.
Good Luck!
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
I need to populate a DGV. I need to be able to index the rows of the DGV by a string variable. But I also need to have duplicate rows in the DGV. A collection allows me to index the rows the way I need to, but doesn't allow duplicate keys. Is there any other alternative?
Thanks
|
|
|
|
|
Hi,
what collection are you using?
some of them (such as List) don't care about unique items, others do (such as Dictionary which requires unique keys).
Luc Pattyn [Forum Guidelines] [My Articles]
DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.
|
|
|
|
|
Hello,
Dim Mycollection as new collection
Are you saying I should be looking into List(of)?
Thanks!
|
|
|
|
|
you should ALWAYS use typed containers.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
if you're using a hashtable, you can make the key map to a list of items, then you can add duplicates there.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
"Make the key map to a list of item" sounds like what I want, but how?
I map my collection (maybe a hashtable) to the DGV
Each item in the collection represents a separate row in the DGV
I write to the collection through the key. Ideally, more than one row could have the same key and would all be written to in the same set.
But collections, hashtables too, require unique keys.
What am I missing?
Thanks again.
|
|
|
|
|
You could create a Dictionary< string, List< someThing>> which would map each string onto a List holding zero, one, or more objects of type someThing.
Luc Pattyn [Forum Guidelines] [My Articles]
DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.
|
|
|
|
|
Yes, that's what I was trying to say :P
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
Hi everyone, im working on the GCS part of our autopilot project. I have developed it in visual basic.net 2005 , what the software basically does is that it receives the values byte by byte, convert them into type double and then displays it on the gauges attached in the design window, im attaching my code below, can someone please tell me if whatever i have done here is correct ?? I would be really grateful thank you (also anyone knows if there is an opensource gcs availible that can receive the serial states serially).
VB.NET CODE:
'Enlisting the classes that could be inherited by this class'
Imports System
Imports System.Drawing
Imports System.Windows.Forms
'Class for the main GCS form
Public Class Form1
Inherits System.Windows.Forms.Form 'Inheritance
'----------------Initializations----------------------------------------'
Dim WithEvents serialportx As New System.IO.Ports.SerialPort 'Declaring serial port form'
Public Delegate Sub throttle()
Public Delegate Sub airspeed()
Public Delegate Sub altitude()
Public Delegate Sub orientation()
Public Delegate Sub direction()
Public Delegate Sub direction2()
Public Delegate Sub rollorientation()
Public Delegate Sub latitude()
Public Delegate Sub longitude()
Dim incomingspeed As Boolean
Dim incomingheight As Boolean
Dim incomingangle As Boolean
Dim incomingposition As Boolean
Dim incomingrollangle As Boolean
Dim incominglatitude As Boolean
Dim incominglongitude As Boolean
Dim receive(,) As Byte
Dim singlearray() As Single
Dim temp() As Byte
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'--------Loading Serial Port Form--------
If serialportx.IsOpen Then
serialportx.Close()
End If
Try
With serialportx 'setting serial comm. parameters
.PortName = "COM2"
.BaudRate = 115200
.Parity = IO.Ports.Parity.None
.DataBits = 8
.StopBits = IO.Ports.StopBits.One
' .ReadBufferSize = 4
End With
serialportx.Open() 'opening serial port
Catch ex As Exception
MsgBox(ex.ToString)
End Try
'------------------------------------------
'--Adding Gauges & Map Controls
Me.Controls.Add(airspeedx)
'Me.Controls.Add(mmap1)
Me.Controls.Add(orientationx)
Me.Controls.Add(directionx)
Me.Controls.Add(altitudex)
'------------------------------------------
End Sub
Public Sub SerialPortX_DataReceived(ByVal sender As System.Object, ByVal e As System.IO.Ports.SerialDataReceivedEventArgs) Handles serialportx.DataReceived
Dim length As Integer
Dim i As Integer
Dim j As Integer
Dim k As Integer
If serialportx.BytesToRead > 0 Then
length = receive.Length()
For i = 0 To 14
For j = 0 To 3
receive(i, j) = serialportx.ReadByte()
temp(j + i * 4) = receive(i, j)
Next
Next
If temp(0) = 102 And temp(1) = 105 And temp(2) = 105 And temp(3) = 105 Then
For k = 0 To 14
singlearray(k) = BitConverter.ToDouble(temp, 4 * k)
Next
End If
End If
altitudex.Invoke(New altitude(AddressOf updatealtitude), New Object() {})
airspeedx.Invoke(New airspeed(AddressOf updateairspeed), New Object() {})
orientationx.Invoke(New orientation(AddressOf updatepitch), New Object() {})
orientationx.Invoke(New rollorientation(AddressOf updateroll), New Object() {})
altitudex.Invoke(New altitude(AddressOf updatealtitude), New Object() {})
End Sub
Public Sub updatealtitude()
With altitudex
.Altitude = singlearray(5)
.AltBarometer = singlearray(5) / 1000
End With
End Sub
Public Sub updateairspeed()
With airspeedx
.Airspeed = singlearray(1)
End With
End Sub
Public Sub updatepitch()
With orientationx
.AHPitch = singlearray(4)
End With
End Sub
Public Sub updateposition()
With directionx
.HeadingIndicator = singlearray(3)
End With
End Sub
' Public Sub updateposition2()
'With mmap1
'.ObjectID = 0
' .ObjectOrientation = receive(4)
' End With
' End Sub
Public Sub updateroll()
With orientationx
.AHRoll = singlearray(9)
End With
End Sub
'Public Sub updatelatitude()
'With mmap1
' .ObjectID = 0
' .ObjectX = receive(6)
' End With
' End Sub
' Public Sub updatelongitude()
'With mmap1
' .ObjectID = 0
' .ObjectY = receive(7)
'End With
' End Sub
End Class
modified on Sunday, June 21, 2009 5:25 PM
|
|
|
|
|
What does 'correct' mean ? Does the program do what you expect it to ? What sort of advice are you looking for ?
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
By correct i mean that im new to vb.net and i just wanted to know whether the code i wrote is going to work or not because i dont have a serial port at the momen and i just want to make sure if things are going in the right direction
Thank You
|
|
|
|
|
I have Notepad in my machine and it is my default text editor. When I double click a text file in Explorer it automatically opens in Notepad.
I have made a similar program. I have compiled it. It reads text files properly. I have published it and made a setup file. I installed the file.
I opened it, opened a text file manually, it opened. I assigned it to be my default Text editor. Now I double clicked a text file and it just did not open at all.
Please tell me how to get this thing done.
|
|
|
|
|
I am not sure if I understood your question correctly. Are looking for FileAssociation? Then, this[^] or this[^] article can help you.
जय हिंद
|
|
|
|
|
Just as another note, Windows passes any files to be opened as command line arguments. If you get any arguments which pass file paths (ie System.IO.File.Exists returns true), then you need to open them
Between the idea
And the reality
Between the motion
And the act
Falls the Shadow
|
|
|
|
|
Does your application handle command line arguments and handle them correctly?? I'm guessing probably not. That's how Explorer tells your app which file was double-clicked. The command line it would use to launch your app would look something like:
C:\Program Files\MyApp\MyEditor.exe "C:\some folder\some other folder\folder\MyTextFile.txt"
|
|
|
|
|
Take a look at this[^]. It contains code snippets and a demo porject project ( I really must learn to type ).
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
modified on Sunday, June 21, 2009 5:22 PM
|
|
|
|
|
Hello -
I am trying to open up an excel file. I am writing this from a Ribbon Command Button using VSTO. My main goal is to open an existing file (\\musabiralo\musa.xls).
When I try this, it opens up in a new Excel Workbook, not too surprised but what I really want to open on existing workbook. Question is how can I do that?
Dim xlApp As New Excel.Application
Dim xlsWB As Excel.Workbook = xlApp.ActiveWorkbook
xlApp.Workbooks.Open(fileFullPath, , True)
xlApp.Visible = True
Thanks a lot.
|
|
|
|
|
musabiralo wrote: but what I really want to open on existing workbook.
You're saying that you already have a workbook open and you want to open a different workbook, merging the two?? You can't. You have to import the data from the other workbook.
|
|
|
|
|
Greetings:
I am back on this question again. My work around did not work.
Let me explain what I am trying to ask here:
I have a 'blank' excel workbook already open which I see in my taskbar. Now I want to open an excel file in this blank Excel which is already open.
If I do "Dim xlApp As New Excel.Application", this will open a new Excel file. If I do "Dim xlApp As Excel.Application", this will cause "Null Reference ..." thing
So, how can I reference the already open excel work book or how can I open the existing excel file in already open excel workbook?
Thanks.
|
|
|
|
|
I am trying to decode a mp3 to wav using Lame.exe. The wav file gets created but, I am having problems trying to get the percentage done to show on a progressbar and the current % in a label.
After trying for about a week now, I want to go a differerent way. Can anyone point me to a site that has a DLL and sample code in VB 8or9? It seems to me that the "MP3 to Wav" subject does not exist in the VB world. I already been to a multitude of sites and 99% of them deal in C++ or DirectDraw which I do not want because converting C++ to VB has a lot of problems, especially (SizeOf) which has no equal in VB. There are a lot more, but that is getting off the subject.
THNX for any help in advance.
rspercy
1 + 1 = 186,440....Depending on the species.
|
|
|
|
|
You have two options. The first is to use a library, like this: DLL To Decode MP3 To WAV/PCM. The second is to manually parse the MP3 file format and write the WAV file yourself
FYI: SizeOf does indeed have an equivalent. In classic VB, you could have used Len. Nowadays, you can use System.Runtime.InteropServices.Marshal.SizeOf
Between the idea
And the reality
Between the motion
And the act
Falls the Shadow
|
|
|
|