|
If you want to know how to use a tree control, try google. If you can't find out something that basic for yourself, then perhaps you need to slow down and start with the basics, for example, how to perform a web search.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I am trying to add a simple datagridview to my form, and want it only to be able to display some arrays, have a user type/copy in some values in various columns and store their input as another array. Yet there is no resource I have found that shows me how to save simple input to a variable! help! I do not want it "bounded", datasourced, dataset, asp, sql, etc. etc. etc. just a plain and simple set of rows/columns to produce some arrays.
Also, I am finding that as I populate the grid with rows it runs extremely slow, and once I have it add over ~300 rows it just freezes up (it populates every hour for a selected time span). I was thinking it was trying to redraw every time it adds a row, but i can't find the option to turn off redraw (you could with datagrid). any thoughts? my code is below.... good god please help
Private Sub dgvMetLoad()
Me.Controls.Add(dgvMet)
dgvMet.ColumnCount = 5
With dgvMet.ColumnHeadersDefaultCellStyle
.Font = New Font(dgvMet.Font, FontStyle.Regular)
.Alignment = DataGridViewContentAlignment.MiddleCenter
End With
With dgvMet
.EditMode = DataGridViewEditMode.EditOnEnter
.BorderStyle = BorderStyle.FixedSingle
.Name = "dgvMet"
.Location = New Point(28, 307)
.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.DisplayedCellsExceptHeaders
.ColumnHeadersBorderStyle = DataGridViewHeaderBorderStyle.Raised
.CellBorderStyle = DataGridViewCellBorderStyle.Single
.GridColor = SystemColors.ActiveBorder
.RowHeadersVisible = False
.Columns(0).Name = "Date"
.Columns(0).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter
.Columns(0).DefaultCellStyle.BackColor = Color.Beige
.Columns(0).ReadOnly = True
.Columns(1).Name = "Time"
'add option for user to select LST or UTC
.Columns(1).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter
.Columns(1).DefaultCellStyle.BackColor = Color.Beige
.Columns(1).ReadOnly = True
.Columns(2).Name = "Dew Pt"
.Columns(2).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
.Columns(3).Name = "Coef a"
.Columns(3).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
.Columns(4).Name = "Coef b"
.Columns(4).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
.Size = New Size(313, 200)
.SelectionMode = DataGridViewSelectionMode.FullRowSelect
.MultiSelect = False
.BackgroundColor = Color.WhiteSmoke
.Dock = DockStyle.None
.BringToFront()
End With
End Sub
Private Sub dgvMetPopulate()
' Add a row for each string array.
'
Dim dtDate As DateTime = modPublicVar.dtDateBegin
Dim dtDateEnd As DateTime = modPublicVar.dtDateEnd
While dtDate <= dtDateEnd
Dim strDate, strTime As String
strDate = Format(dtDate.Date, "MM/dd/yyyy")
strTime = Convert.ToString(dtDate.TimeOfDay)
Dim row As String() = {strDate, strTime}
Me.dgvMet.Rows.Add(row)
dtDate = dtDate.AddHours(1)
End While
end sub
|
|
|
|
|
|
you may print any thing using graphics library
see this, it will help you
http://testspot.net/Guest/Search.aspx?Section=Forums&q=How to print grid in Vb.net
|
|
|
|
|
If have one doubt:
How I can do that the width of the last column occupy the rest of the with of the datagrid. So, I avoid that it is left a hollow great.
|
|
|
|
|
hi
please tell me how i can print a from in page with size A5
|
|
|
|
|
Code: Printing a Windows Form (Visual Basic)[^]. Just modify the PrintDocument1.DefaultPageSettings.PaperSize before you call PrintDocument1.Print() .
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi,
I have a little problem, I have a 2-form application where I can open the second form by clicking a buttom on form1 (that works fine). but when I click the close button (the red X in the upperright corner) the form closes down, and when I click the button on form1 to open form2 again I get this error:
An unhandled exception of type 'System.ObjectDisposedException' occurred in system.windows.forms.dll
Additional information: Cannot access a disposed object named "frmPlot".
I 'dim' form2 after the 'Windows Form Designer generated code'-region as a new Form2.
and the button only call the show() function.
Do I have to dim a new form2 when the button clicks? because I want the information on form2 to left there when I close it down, and when I open it up again it should still be there.
My main question is:
Is there a way to cancel that closing/destroy-function the closing button does and do a form2.hide() instead?
Regards /Joakim .A
Joakim .A - State: VB6 -> VB.NET
|
|
|
|
|
Sure you can. Override the OnClosing method of form2, set the Cancel property of its eventargs to true and call hide instead.
|
|
|
|
|
I need to be able to restrict which files are displayed in a ListView control according to the file extensions. This was fine until my customer says that they do not display file extensions! Can anyone please let me know if it is possible to get the file extsion from a given PIDL (it won't be in the display name).
|
|
|
|
|
So what if they don't display extensions. The File and FileInfo classes will still retrieve them from the file system when you enumerate the files in a directory. Just put the full path to the file (including the filename) into the Tag property of each ListViewItem.
...unless I've missed something...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanks for that but the project in question is written in VB6 so .NET classes are unavailable. I have to do things via API calls.
|
|
|
|
|
Same answer, only use the FileSystemObject to get the filenames.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I want to find a record in a Adodb.recordset.
By using Find Method, this statement could not pass:
"ID=3 and Name='Tome'"
And the seek method could not be used for adUseClient.
How to do?
Thanks!
|
|
|
|
|
Try filter. Find in ADO only accepts 1 parameter while in DAO you could have more. Seek is supposed to be its replacement but as you found thats not always suitable. Filter should do what you want.
Jon
|
|
|
|
|
Thank you very much.
Filter is good.
Seek has error. Could you give me an example?
|
|
|
|
|
To set a filter is simple
rs.filter= "myNumberField = " & myNumberVar & ""
The filtered recordset is now a mini recordset which could contain 0,1 or many records based on the filter criteria. When you are done do the following to remove the filter
rs.filter = ""
Jon
|
|
|
|
|
Hi, I am trying to convert a unicode string containing characters with different code page (Basically a set of hex data stored in a string). When I tried to convert them they somehow get mixed up by VB. Does anybody know of a low level way of converting strings to Byte array? I am using VB6 by the way.
Thanks.
SDE
|
|
|
|
|
A quick Google for "VB6 convert string byte array" comes up with:
' Convert string into a byte array:
Dim b() As Byte
b = "This is the String"
' Add null termination:
Redim Preserve b(0 To Ubound(b) + 2) As Byte
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I am using vb.net 2005 beta 1.
Thanks!
|
|
|
|
|
That depends on what you mean by "default button". Have you looked at the AcceptButton property of the form?
You also might want to set the TabOrder of the button to 0. But, that depends on what your doing with your form and on what control you want the focus to being at.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
i want search/ find text/word in editor using API VB.
I succeded to get 'FindWindow' But after clicking on 'Find'
button no response. I want to jump on matching word/text.
Why this occured ? Does anyone know?
Any help appriciated?
|
|
|
|
|
Uhhhh.... What?
Are you trying to control Notepad or Word? Are you trying to control their Find/Find Next search boxes?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I am using 'DHTMLEDIT' control.
i want use FindNext to word/text in 'DHTMLEDIT' like 'Find' used in 'Notepad'.
|
|
|
|
|
You left the most important detail out of your question.
The DHTMLEdit control is so old, MS doesn't even have the docs for it anymore. I've never used the control, so without the docs, I can't tell you how to get it to pop up it's Find window. You might want to consider using a newer component. There's a bunch out there.
But, if you want to keep using this thing, look into finding other examples of people using the control. Just Google for "DHTML Edit Control". You could probably start with this[^] example.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|