|
Hello,
I'm working on a Excel Add-in project in VSTO professional.
What I try to accomplish seems simple, but I cannot figure it out.
I have an excel XLL addin in resources.
On thisaddin.startup I save the xll file in folder in my documents.
What I want to do in the run time is to go and register/add this XLL addin to excel application.
Basically want to replicate following manual steps:
file->options>addins->excel addins->Browse to my folder--> add
Thanks a Lot!
|
|
|
|
|
I make setup of my project, I have crystal report in my project. When i install my setup to the users machine then this setup does not support to crystal report please tell me what is problem and that problem solution ?
|
|
|
|
|
saedawke wrote: I make setup of my project How? Using Visual Studio, InstallShield, Wise?
saedawke wrote: this setup does not support to crystal report please tell me what is problem and that problem solution CR is not installed by default, nor automatigally included. You'll need to add it to your setup as a prerequisite. Depending on what software you are using to build a setup that could be an MSI or a merge module.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Hi,
I've spent the last few days looking at approaches to creating a 3D display of data points (as a small sphere) and lines (linking the spheres & as a co-ordinate axis).
I did think that DirectX was the solution, but it appears to be not supported for VB.NET under the V4 .NET Framework (?).
So I have installed XNA v4.0 as this seems to be the 'new' way of performing 3D graphics.
My goal is to have a form with a picturebox or appropriate control that I can write "data points" on to in a 3D space. I also want the user to be able to zoom and pan to view the data.
I have had no luck finding straight forward examples in VB (I'm not a c# guy). I have found examples that write circles and lines to a 2D space using XNA but nothing more complex than that.
I would really appreciate any suggestions on where to find a good VB.NET resource for XNA. A post of some sample code would be even better !
Thanks in advance.
Regards
RS
|
|
|
|
|
Getting XNA to show in a WinForm is not a simple task; 3D graphics are not part of the Framework.
You could start here[^]. There's two more options, both "not easy". You could try and find a DirectX3D tutorial, or go for OpenGL[^] - which would have my preference, as it is available on multiple platforms.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Hello !
I have a List of KeyPairValues(of Integer,Boolean).
Is there any short way to detect if a specific Key exist in at least one of items of the list ?
( like a Contains method )
Thank you !
|
|
|
|
|
Have to you read the documentation on the collection you're using, or even looked at the Intellisense after you hit the "." after the Key property? There's always a Contains method on it.
|
|
|
|
|
yes , but I'm searching only for Key . If I do contains for the list of keyvaluepair , I need a keyvaluepair to search for. I know only the key . how to construct the Keyvaluepair with a key and unknown value in order to use the contains ?
|
|
|
|
|
satc wrote: yes , but I'm searching only for Key
And? That's exactly what Contains does!
satc wrote: If I do contains for the list of keyvaluepair
Wait. You have a List<KeyValuePair<something, something>> ? Why are you not using a Dictionary<key, value> ?
|
|
|
|
|
Quote: And? That's exactly what Contains does!
Ok , please can you show me an example :
Dim lst as List(of KeyValuePair(of Integer,boolean).
Please show me a example with contains to find if an item with .key=5 exist in this list.
|
|
|
|
|
You weren't very specific about what you had. If you go back to what I posted, you'll find I said "Keys property", which is itself a collection.
You don't have that. You have a List<>, which doesn't implement a Keys collection on it's own.
Instead of using a List<keyvaluepair<k, v="">>, you should being a Dictionary<k,v> which implements exactly what you want without you having to implement it yourself.
Dim myCollection As New Dictionary(Of Integer, Boolean)
...
Dim result As Boolean = myCollection.Keys.Contains(5)
|
|
|
|
|
If I would like to use dictionary , I wouldn't make the question about List.
So your response is off topic.
|
|
|
|
|
No, it's not. Why the hell are you using List<KeyValuePair<>>?
|
|
|
|
|
Because sometimes I need to iterate through the list using the position of each element like this
for I=0 to list1.count-1
...
Next
Can this be used in a dictionary ? ( Exactly like this ??)
|
|
|
|
|
Man you make this difficult. "Just tell me how to do this" without ever explaining why you think you need to do it.
No, a Dictionary<> can't be indexed like that. As you already know, a List<> can. The solution is to make your own List<> class, inheriting from List<KeyValuePair<TKey, TValue>> . You're going to have to implement your own Keys property to expose a Contains for it. Also, you need to expose your own Add methods to add values to the collection. It's really very simple.
Public Class KeyValueList(Of TKey, TValue)
Inherits List(Of KeyValuePair(Of TKey, TValue))
Private _keys As New List(Of TKey)()
Private _values As New List(Of TValue)()
Public ReadOnly Property Keys() As List(Of TKey)
Get
Return _keys
End Get
End Property
Public Overridable Sub Add(key As TKey, value As TValue)
_keys.Add(key)
_values.Add(value)
MyBase.Add(New KeyValuePair(Of TKey, TValue)(key, value))
End Sub
Public Shadows Sub Add(value As KeyValuePair(Of TKey, TValue))
_keys.Add(value.Key)
_values.Add(value.Value)
MyBase.Add(value)
End Sub
End Class
You use this class instead of the List<KeyValuePair<TKey, TValue>> you used. Since it inherits from List<> , it automatically exposes the index property and you get Keys and Values collections that are also indexed and support Contains since they are Lists too.
|
|
|
|
|
Well , I was thinking if a short way exist , because instead of doing your solution , I can just write
List1.Select(Function(t1) t1.key).Contains(MyKey)
But I thought this solution was not the best.
|
|
|
|
|
Define "not the best". That doesn't say anything at all about what's wrong with the approach. I can only guess at what you mean.
So, I go from the standpoint of performance. Every time this line is executed, the code has to build a collection of those keys from scratch and scan each key comparing to the input.
The way I do it, you're maintaining the list of keys constantly. It doesn't have to be built every time. I can also be improved for better lookup performance depending on requirements.
|
|
|
|
|
Using LINQ:
Dim inList As Boolean = YourList.Any(Function(pair) pair.Key = TheKeyToFind)
If you're going to be looking up specific keys, you might be better off using a Dictionary(Of TKey, TValue) [^] instead.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
In a vb.net 2010 desktop application that is using a system.windows.forms.datetimepicker, I am having a problem with. The problem is the datepicker will only allow me to select one month in the past at a time. I hit the down arrow where the date is displayed and then hit the previous button where the month and year are displayed. If I want to go back 3 years in the past, I have to keep this process up 36 times.
I would think I should only have to hit the down arrow where the date is displayed one time, and then keep hitting the back button until I find the month/year I need from 3 years ago. The default selection for the datetimepicker is set today's date since this is what will be used about 95% of the time.
Thus can you tell me what I can do to solve this problem?
|
|
|
|
|
When you see the MonthCalender, displayed by the DateTimePicker, you could move the Cursor over the displayed month and year on the Top.
If you Click the Year now it changes to a NumericUpDown and you could change only the year.
Did you mean something like this ?
modified 18-Jun-15 14:25pm.
|
|
|
|
|
The DateTimePicker will only let you pick a SINGLE point date/time. It will not let you pick a RANGE of dates.
|
|
|
|
|
Hello !
On a Microsoft Word Document , even when a save a document I can undo/Redo step by step all changes that I've made ( until I close the document ).
Is it possible to mimic this behavior on an vb.net application that use a SQL server database ? ( Of course when a record is not yet saved is easily possible to Undo changes , But if is saved ?????) . I'm thinking what is the way that use an application like word to keep in memory changes and easily can move back or forward step by step.
Any idea how can this be realized on a VB.net /SQL server application?
Thank you !
|
|
|
|
|
I'd recommend a memento-pattern; would be a layer higher than the database, and works best if the data is not saved yet.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
MS Word has a comparatively easy job with undo/redo functionality because it's just a single document. Implementing undo/redo for a database application where it should also work for already saved records is a lot more complicated. It gets even more complex if you have data that has to be auditable, like financial transactions. You might want to consider just skipping this feature; after all it can't even remotely be considered standard for database applications. Or maybe implement it in a future release - from what I gather you're developing a new application currently. However..
As the granularity I would choose transactions in order to be able to maintain data integrity.
So you would have to have something like a TransactionID in every entity in order to be able to figure out which entities were created/modified/soft-deleted within the same transaction. Also a history for modified entities (which you already have or plan if I remember correctly). And then if a transaction should be undone, reverse the last action on each entity with that TransactionID. Created ones would be hard-deleted, modified ones their previous values restored from history, soft-deleted ones restored to not deleted.
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
|
|
|
|
|
It gets worse than that - if you undo your changes, you also have to undo everyone else's changes that have been made since the change you're trying to undo.
For example:
- User A adds a new customer and saves;
- User B adds a new order for the new customer and saves;
- User A now tries to "undo" the new customer;
For user A to "undo" the new customer, they also have to "undo" user B's change.
Also, updates made by other users might not have been allowed without the update made by the first user - think bank accounts, balances and transfers for example.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|