|
I want to display a syncfusion menubar alongwith a logo on its side on the top of a Windows Form.How do i go about this?
Keshav Kamat
India
|
|
|
|
|
What's a syncfusion menubar?
3d party control?
If so - does it come with documentation?
-Larantz-
|
|
|
|
|
I'm trying to include a c++ dll in my C# project. Im having some problems. I need to check and see if the problem lies in my C# code, or the C++ DLL code. Can someone link me to a C++ DLL that they know works when called correctly from C#? Something simple that I can test my syntax with. Thanks.
|
|
|
|
|
To call methods from c++ dll by using P/Invoke. To test your c# syntax just call any winapi function so you won't need any extra dll's. For examples of platform invoke have a look at this website: http://pinvoke.net/
|
|
|
|
|
Thanks Giorgi.
|
|
|
|
|
the use of this class inorder to pass data between forms :Application.OpenForms["OpenFormName"].Controls["ControlName"].Text
But I can't manage to use this myself, how do I use it properly to pass data from a variable in class A to a variable in class B??
|
|
|
|
|
Where did you read it? It will have more information about it. Have a look at this too:
http://www.codeproject.com/dotnet/passingvaluesbetweenforms.asp
|
|
|
|
|
|
I'm currently working on a small DLL that enables you to change control names on the fly (e.g. used for swapping languages).
Works fine so far, however I have a problem with the MenuItems.
The names are stored in a text file like this:
FormName.ControlName;english name;german name;french name
However the MenuItems names cant be retrieved at runtime? There is no .Name property for the MenuItems.
Any ideas?
|
|
|
|
|
c0rvus wrote: There is no .Name property for the MenuItems.
There is name property for the menuitem but it is the name of the menu. If you can retrieve the menu object then you can access its items through the MenuItems property
|
|
|
|
|
Hm,.. I know how to retrieve all the MenuItems from the Menu itself but I dont know how to retrieve the name of a MenuItem which is extremly important to me as I need it to create a unique identification for each control.
for instance:
ContextMenu
->mnuItem1
->mnuItem2
->mnuItem3
->mnuSubItem1
->mnuSubItem2
is my menu.
That would mean i had the following entries in my textfile:
Form1.mnuItem1;....;....
Form1.mnuItem2;....;....
so i would try something like this:
private void RenameMenuItem(MenuItem item, string formName)
{
GetName(formName + "." + item.Name) <--- that would be what i'd like it to be
foreach(MenuItem menuItem in item.MenuItems)
{
RenameMenuItems(menuItem);
}
}
You see, I really need the item's name to read the according new name from the text file.
|
|
|
|
|
You might want to be careful changing the Name property of the controls (even MenuItems) at runtime. This property is what the runtime uses to identify each control, not what is displayed on screen. For that, you generally need to change the Text property.
There is a Name property for all UI controls, you may need to cast the object back to a MenuItem in order to access it.
|
|
|
|
|
Thanks. I know that I shouldnt change the Name property (if I remember correctly thats not possible). I do only need it to create a unique identification string to search that in my text files.
I've tried casting MenuItem back into Control but that gives me a compiler error :/
|
|
|
|
|
You shouldn't be casting MenuItem to Control , it should probably be the other direction. The Name property should always be unique (and if you're using the Forms designer it will guarantee that it is) so that should be your key into the text file.
Since you are trying to do localization, is there a reason you aren't using the built-in localization that Windows Forms and .NET provides?
|
|
|
|
|
I'm doing the localization just for educational purposes (or whatever you call that )
Just to know if I can do it.
I think the casting wont work since MenuItem is not derived from the Class (They are both derived from the Form Class if i remember correctly).
After trying for some time now I might stick with the solution to simply get the names of the menu itself and name the MenuItems Form1.mainMenu.Item1 to ...ItemXX. Cant get anything else to work :/
|
|
|
|
|
Hy
I have a RichTextBox.
When I press any alphabetic key on RichTextBox_KeyDown the e.KeyValue have the ascci code for the bigger letter. I press "q" and the e.KeyValue have the ascci code for "Q". How can I detect what key I pressed?
thanks
|
|
|
|
|
You've already identified what key you've pressed. Do you mean how do you work out what character it was? If so, just cast it to a string.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
I cast to string.
When I press "q" the e.KeyValue = 81 ... the ascci code for "Q".
So I can detect If i press down "q" or "Q".
|
|
|
|
|
|
e.KeyCode and e.KeyValue have the same ascci value
|
|
|
|
|
You have only one key on the keyboard so that's why you are getting the same value. You can check for caps lock like this: Control.IsKeyLocked(Keys.CapsLock) and extract information about shift button from e.Keydata. Based on these two pieces of information you will be able to determine whether 'q' was typed or 'Q'
|
|
|
|
|
Hi,
KeyDown/KeyUp events offer a KeyEventArgs with amongst others these key information properties:
· Keys KeyCode: the keyboard code
· Keys KeyData: the key data (i.e. the key that was pressed, combined with
modifier flags that indicate which combination of CTRL, SHIFT, and ALT
keys was pressed at the same time.)
· int KeyValue: the integer representation of the KeyCode property
KeyPress events offer a KeyPressEventArgs with amongst others these key information properties:
· char KeyChar: the character (with correct casing)
The KeyPress event is not raised by noncharacter keys; however, the noncharacter keys do raise the KeyDown and KeyUp events.
The typical use would be to process KeyDown to handle special keys (such as Enter, Backspace,
and CTRL/X combinations), and to process KeyPress to consume regular keys (as in adding
characters to text)
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
How do a set a timer to a function in my windows form?
that it will run ( for example every min )
tnx mates!!
|
|
|
|
|
Simplest way: Drag a timer object on your form, set up event handler for tick event and in the event handler call whatever method you want
|
|
|
|
|
how to fire application_end
application_start gets called
but end is not firing
what should i do
thanks
|
|
|
|