|
|
I wanted to pragmatically change the content of a cell. So I have tried something like this
Private Structure Items
Dim ID as Integer
Dim Name as String
End Structure
Dim objItem as Items
Private Sub AddItem()
objItem.ID = 1
objItem.Name = "Name"
objectlistview.AddObject(objItem)
End Sub
Private sub ChangeItem()
objItem.Name = "MyName"
objectlistview.RefreshObject(objItem)
End Sum
AddItem() method is working fine. But ChangeItem() method doesn't work. What's wrong with code
|
|
|
|
|
|
Do not use such a confusing naming of your variables! When I read Items , I expect some kind of a collection/array. And better use a Class instead of a Structure .
In your ChangeItem function, you must retrieve the item from the listview, and then change its properties.
|
|
|
|
|
I programming in Visual Basic .Net 2010 and I need to display images from a database and displayed in windows explorer (image and name, in rows and columns)
I was thinking of using listview but I think when I have thousands of pictures will be very slow to load the listview
can you suggest me something about it, thanks
|
|
|
|
|
Member 9283091 wrote: I need to display images from a database and displayed in windows explorer What does "in Windows Explorer" mean? Does it have to look like a folder when browsing using the Explorer? Or does it simply need to run under Windows and look "similar" to the Explorer?
Member 9283091 wrote: (image and name, in rows and columns) Sounds like a good place for a virtualized DataGridView .
Member 9283091 wrote: I was thinking of using listview but I think when I have thousands of pictures will be very slow to load the listview Loading a list of strings into a ListView doesn't take that long; it depends on what you're showing, and how. Reading the image will always take a while, and reading images that aren't displayed on screen takes even more time. A datagridview can have an image-column, and if it's virtualized, it'll only load/display the image that's visible.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
I am assuming this is relatively simple, but I have not been able to figure this out as of yet.
I have an external WPF application that I cannot modify, but I would like to retrieve the data from a control in the application.
I have the code to retrieve the application top window from the windows API and the code needed to traverse the visual tree to find child items.
The problem lies in getting the window (which is contained in the HwndWrapper) into an object in my program that I can use to send to my code to find the controls I need.
I have tried searching and have come up with the following:
Using HwndSource.FromHwnd() - Returns Nothing
Casting a custom window class to Window - Will not convert
Inheriting from Window in custom window class - none of the attributes I need get populated this way.
I know that this can be done, as the opensource project, snoop, is able to get the data. Unfortunately it is written in C# with a C++ ManagedInjector and I am not as proficient in these languages as I am in VB, so while I can read and understand some of it, the rest is lost on me.
I truly hope that someone will be able to help me with this project, as I am ready to tear my hair out.
Thanks in advance.
|
|
|
|
|
Hi Mr, I know few things about WPF, I can be wrong, but I vaguely remember that a WPF window do not 'use' child windows, I mean child windows do not 'exist' as in C++, Windws Forms ,etc., but really they are all together painted only on one main window. Hope this helps, Carlos.
|
|
|
|
|
Thank you. I did read that the controls in a WPF application do not have handles and therefore must be traversed through with a TreeHelper/Walker, but I cannot figure out how to get the initial element to start the process. I have the names of the controls I need to find by using Inspect and Snoop, but finding the controls by name seems to require an initial element.
|
|
|
|
|
Hi, perhaps the initial element is the biggest container, like, Canvas, InkCanvas, or it can be the main window
|
|
|
|
|
Yes, the initial element would be the main window, but obtaining that element as an object that can be used is the issue that I'm having
|
|
|
|
|
Hi, try google with wpf spy utility, you'll find snoopwpf on codeplex, also http://msdn.microsoft.com/en-us/library/ms742404.aspx[^], hope this helps. Well, this does not answer you question, but I suppose it could help you, yet also I have not used any of these tools Smile |
|
|
|
|
|
I do have the snoop sourcecode and have looked through it, but unfortunately it is a bit too complex for me to understand in its entirety.
|
|
|
|
|
Perhaps there exist another WPF code to accomplish this idea, (please excuse my English grammar, it is not my native language). Also there is no more the usual OnPaint event, it has been replaced also by OnRender or something more else, unhappiliy I don't remember now. Hope this helps, Carlos
|
|
|
|
|
hi All
Using VB6 as front end and MS access as database i am trying to do a wild search on customer address field so my problem is i need to insert the record which has record count <=1500
Below is my code which i used only to Select and insert
"gql = "Insert Into out_1 SELECT DISTINCT MSISDN,CUST_NAME,STATUS,CUST_ZIP,CUST_ADDRESS,total_outstanding,ACCOUNT_NO FROM base where CUST_ADDRESS like " & "'%" & Text3.Text & "%' group by MSISDN,CUST_NAME,STATUS,CUST_ADDRESS,CUST_ZIP,total_outstanding,ACCOUNT_NO
Can some one help me on code that insert only if record count is <=1500
|
|
|
|
|
1. VB6 is no longer supported; plan to move to a currently supported language.
2. Break the problem into pieces and work them seperately.
For example: find data sets that have more than 1500 records and less than 1500 records, then, using JUST the select statement, run the query to see what is returned.
Also, look into the 'HAVING' clause. You should be able to search for it and find help there.
|
|
|
|
|
|
|
Good advice, Richard
|
|
|
|
|
Richard, isn't a Skype Bruter malicious code?
This message is manufactured from fully recyclable noughts and ones. To recycle this message, please separate into two tidy piles, and take them to your nearest local recycling centre.
Please note that in some areas noughts are always replaced with zeros by law, and many facilities cannot recycle zeroes - in this case, please bury them in your back garden and water frequently.
|
|
|
|
|
|
I have a simple WinForms application with data displayed in a property grid.
Now i am trying to make the application a little more user friendly for a touch screen operation.
I have added simple user control with buttons to simulate a virtual numeric keyboard. The problem is that as soon as i press the buttons on the usercontrol the PropertyValueChanged fires even though the PropertyGrid.ContainsFocus still is true.
This is causing a problem because the input is not yet ready and may still be under/over limit causing the property grid to revert back to its old value.
First i thought it was a problem with the user control stealing focus so i added the following code that i found i a forum to the buttons but the event still fires.
Friend Class UnselectableButton
Inherits Button
' The WS_EX_NOACTIVATE value for dwExStyle prevents foreground
' activation by the system.
Private Const WS_EX_NOACTIVATE As Long = &H8000000L
''' <summary>
''' Set the form style to WS_EX_NOACTIVATE so that it will not get focus.
''' </summary>
Protected Overrides ReadOnly Property CreateParams() As CreateParams
<PermissionSet(SecurityAction.LinkDemand, Name:="FullTrust")>
Get
Dim cp As CreateParams = MyBase.CreateParams
cp.ExStyle = cp.ExStyle Or CInt(Fix(WS_EX_NOACTIVATE))
Return cp
End Get
End Property
Public Sub New()
MyBase.New()
Me.SetStyle(ControlStyles.Selectable, False)
End Sub
Private Sub InitializeComponent()
Me.SuspendLayout()
'
'UnselectableButton
'
Me.TabStop = False
Me.ResumeLayout(False)
End Sub
End Class
Does anyone know how to suppress PropertyValueChanged or any other way around the problem.
|
|
|
|
|
|
gostaria de ciar o id auto_increment e da erro .
me ajude por favor
Sub criatabelaconfiguracoes()
Try
Dim conn As MySqlConnection
Dim strConn As String
Dim cmd As MySqlCommand
strConn = "Server ='" & txtServer.Text & "'; userid = '" & txtUser.Text & "'; password = '" & txtSenha.Text & "';"
'strConn &= "Database = mysql; pooling=false;"
conn = New MySqlConnection(strConn)
cmd = New MySqlCommand("Create Database If Not exists habitacao", conn)
conn.Open()
cmd.ExecuteNonQuery()
conn.ChangeDatabase("habitacao")
Dim sbCmd As New System.Text.StringBuilder
sbCmd.Append("CREATE TABLE configuracoes")
sbCmd.Append("(id INT(10)," & _
"tempolog varchar(255)," & _
"nomesistema varchar(255)," & _
"impressora varchar(255))")
cmd = New MySqlCommand(sbCmd.ToString, conn)
cmd.ExecuteNonQuery()
conn.Close()
criatabelausuario()
Catch ex As Exception
MsgBox(ex.ToString)
End Try
End Sub
|
|
|
|
|
You have been a member long enough to know that this is an English language site.
Use the best guess
|
|
|
|