|
plz help me
i am new to word addins i want to create my menubar for word document by using c# sheared addins i am not able to inshilize word menubar object
private Office.CommandBar menuBar;
menuBar = this.ActiveExplorer().CommandBars.ActiveMenuBar;
|
|
|
|
|
Hello,
i am using a treeview so to assign different icons to different nodes i used a imagelist and assigning the imageindex and selected imageindex properties of the treenodes with the index of the imagelist icons collection. But for some nodes in the treeview that setting is not working its displaying the icon at the 0th index in the imagelist and whenever i display the index value associated with that node using a messagebox its giving "-1" value.
Why thats happening how can i get the icon which i assigned using imageindex and selectedindex to those nodes.
Please help me,
thanks in advance.
|
|
|
|
|
i'm new cumer for C#,so i have created small programme that display sum details as wel as retrive there details as they want.so i've puted the menu there for open a new windows when user to view many windows,hw can i give coding for that?
In VB.net i can give
Main Window name-:frmmain
In the sub window i can create object of the main window an call that window from the sub window like as follows
dim object_name as new frmmain
object_name.show()
how can i give coding for call the windows in C#?
|
|
|
|
|
The way I read it you want to open a new Window..
form name: frmName
frmName frmName = new frmName();
frmName.Show();
If you didn't mean to open a form then I am misreading your post and am sorry
|
|
|
|
|
Chris Maunder wrote: Be specific! Don't ask "can someone send me the code to create an application that does 'X'. Pinpoint exactly what it is you need help with.
Click here![^]
Regards
|
|
|
|
|
How to generate a random number.
I have Visual Studio 2003.
Help.
Vasildb
|
|
|
|
|
use the following code snippet:
Random rand=new Random();
and then u can use
rand.Next(1,100);
to generate a random no. between 1 & 100
Basically u have to specify the limits in which u want to generate a random no.
Hope this will work.
NEHA GUPTA
|
|
|
|
|
Neha_Gupta wrote: and then u can use
rand.Next(1,100);
to generate a random no. between 1 & 100
That will generate a random number between 1 and 99.
---
b { font-weight: normal; }
|
|
|
|
|
Thanx Guffa for correcting me
NEHA GUPTA
|
|
|
|
|
Thanks Guffa. This information helped me too. I was using the random generation in my program and was thinking the probability of generating last number could be less... but now came to know it does not generate. Intead it generates till one less(as in your example betwen 1-99) Thanks again!!!
- ashish
|
|
|
|
|
dear programmers
i have an application made in c# support multi language when installing on other pc i dont want to install language support from windows cd i want to intall it through my installing program how can i do it.
how to install asian language support for windows when installing my software any idea or where can i get setup files thant can run when installing a software.
sikandar
|
|
|
|
|
The whole setup this implies is difficult at best (if you are just looking to have your program running in a certain language). It probably would be best to get a Multi-Language Windows-Release and install your program there, then choose your program's display language according to the language options currently selected in Windows.
However, I would roam the net and look for a language installation package, then add it as a script to your install-packet-creator.
Or, x-copy-installations, check if the computer has the language support and run the language installation if it does not.
Cheers,
Sebastian
--
Contra vim mortem non est medicamen in hortem.
|
|
|
|
|
can u plz tell me where i can get multi language support file..
sikandar
|
|
|
|
|
Hi,
Im looking forward to create my own component (Eg:Combobox) using C# by adding my own appearence and features without inhariting inbuilt controls in .net framework.But still i couldn't find the way of doing this.Please send me a way to do this and related references.
Thanking you,
Pubudu
|
|
|
|
|
|
This is my comparer:
public class movieIdCompareValueClass:IComparer
{
public int Compare(object a, object b)
{
return ((allInfo)a).movieId.CompareTo(((allInfo)b).movieId);
}
}
I am using it in:
found = Array.BinarySearch(outerContents, movieId, new movieIdCompareValueClass());
I have tried a couple different ways to set up the comparer, but I always get a runtime error on the above line:
System.InvalidOperationException
Additional information: Specified IComparer threw an exception.
What is causing this error? Is the comparer looking beyond the last element of the outerContents array? If so how do I prevent it?
|
|
|
|
|
It would be nice to know what exception the IComparer threw. It should be accessible through the InnerException property of the thrown InvalidOperationException .
If I have to guess, I'd say that you are getting an InvalidCastException . It seems your outerContents array contains allInfo objects as you're casting the objects a and b to it in your compare method. As object to search for you pass in something called movieId, so I guess it's a plain int or something similar which can't be cast to allInfo.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
I may be off base, but at first thought, you are using a compare to complete a compare.
Try writing your own comparer long hand.
|
|
|
|
|
hi all,
can anyone tell me where reflection finds its use in a real time system?
thanks in advance,
lavanya
|
|
|
|
|
It will be used when you want to
-load an assembly
- iterate the methods in assembly
- Call the methods etc.
@ runtime
Say for eg in my project i will get the method and assembly name in an xml, So my exe will read the XML file and has to execute the method,
My Project: Test engine - it will get teststeps(method names) in an xml file from a server and will execute in the client machine
Hope you got atleast one real world application example
|
|
|
|
|
Beside what engsrini alrready said, you can think of it as an advanced way of dynamic coding. Currently it isn't widely used, but I believe in the future it may. One example is like making your own forms editor. Something like MS Access where your users can make a form and bind it to the Db. Maybe you want to add custom controls in your form.
Another example is using reflection as a mean of adding update capability in your program, where you dunamically instantiate a class from a dll and call certain methods. When you update all you need to do is to replace that dll. I know this is crap but it is possible.
One last thing is to use reflection to reference to a library that is not included in your program by default -for example optional downloadable plug-ins to your program-, and make error checking when using the classes in it. So that users can un/install plug-ins as suits them without changing anything in the main program. If a plug-in makes an error or was deleted by mistake, using reflection and not hardcoding the references into your program will give you flexibility and prevent your program from crashing.
That was some of the things I could come up with in 5 minutes. Creativity has no limits.
Regards
|
|
|
|
|
Lavanya
We have a business rules engine which allows us to bind in custom objects at run time. How this works is the customer develop a custom object that implements an interface called IBindingObject. The rules engine loads the object (using reflection), and verifies that it does indeed implement IBindingObject. We then use reflection to call other methods to find out and use the rule capabilities of the custom object.
HTH
Arthur Dent - "That would explain it. All my life I've had this strange feeling that there's something big and sinister going on in the world."
Slartibartfast - "No. That's perfectly normal paranoia. Everybody in the universe gets that."
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Thanks guys. I am very new to this concept of reflection. and when i read abt it i was wondering how this could be used in real time apps. that is y i posted the msg. i got some idea now. thanks a lot.
|
|
|
|
|
hi i want to hide some of the nodes of the treeview based on some condition how can we implement that. There is no such property for a node to make invisible.
thanks.
|
|
|
|
|
There is no way to make a node invisible. You can remove the items you want to hide.
|
|
|
|