|
Hello
In my program I dynamically load DLL, but I have some problem. Dll use my program config and not his own confg. Here is part of the code:
Assembly assemblyInstance = Assembly.LoadFrom(assembly);
Object ProviderClass = assemblyInstance.CreateInstance(type);
object[] methodMaramList = new object[1];
methodMaramList[0] = logInInfo;
if (providerInfo.GetInformation == false)
throw new Exception("This provider does not support get abonent function.");
authorizationResponse = (AuthorizationResponse)assemblyInstance.GetType(type).InvokeMember(method,
BindingFlags.Public |
BindingFlags.InvokeMethod |
BindingFlags.Instance,
null,
ProviderClass,
methodMaramList);
|
|
|
|
|
Which one of the code lines causes a problem? What's the error message?
What is "providerInfo"?
|
|
|
|
|
Hi,
When I try to enter ALT+1(Num Lock pad) in a text box, its loading as ☺ in textbox. How to avoid such symbols. I tried to avoid taking input from num lock pad and wrote the below code. But still its showing symbols. Please let me know how to avoid those. Thanks in advance
private void txtHotKey_KeyDown(object sender, KeyEventArgs e)
{
//for Num Lock keys 0-9
if (e.KeyValue==18 || e.KeyValue > 95 && e.KeyValue < 106)
{
return;
}
}
|
|
|
|
|
Pressing Alt with the number keys generates special characters with the value of the keys pressed. So for example Alt+65 would give the character A which has the decimal value 65 (hex 41).
I must get a clever new signature for 2011.
|
|
|
|
|
thats fine.. But how to avoid those special symbols programmatically.
|
|
|
|
|
HaroldVish wrote: But how to avoid those special symbols programmatically
You shouldn't. The facility is provided to allow people to enter codes which are not directly available from their keyboard: À rather than A for example. It you cut down on what a user is used to doing, then they will probably get frustrated and annoyed with your program.
Imagine for example, that someone wishes to enter Arabic or Chinese characters: should you stop that, too?
Why are they causing you a problem?
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
Digital man: "You are, in short, an idiot with the IQ of an ant and the intellectual capacity of a hose pipe."
|
|
|
|
|
Did you notice that little KeyEventArgs thingy in the KeyDown handler? it has some properties and some methods, you need one of each: Handled and SuppressKeyPress() . Use Google and read the documentation.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
Hi,
Create a function which scan all text char and check whether it is a special character or not, if it is then remove the character. Call this function on the leave event or text change event.
C#, VB.NET,ASP.NET DEVELOPER
|
|
|
|
|
hi
looking for how to make my own MessageBox sample code
something simple that has title, body text and yes/no button
and how to use it
thanks in advance
|
|
|
|
|
|
Why would want to reinvent the wheel?
|
|
|
|
|
|
Hello all,
i'm trying to do sequential reading from a OleDbDataReader that is retrieving an xml stream generated (string) in the sql server but i end up with an invalid cast exception.
The same code works like a charm using SqlDataReader, but for some reason, i had to integrate with another connection object and retrofit the code to use OleDbDataReader.
Have anyone ever experienced something like this?
_reader = _command.ExecuteReader(CommandBehavior.SequentialAccess);
while (_reader.Read())
{
_index = 0; ;
_read = _reader.GetChars(0, _index, _chbuff, 0, BUFF_SIZE);
while (_read > 0)
{
_writer.Write(_chbuff, 0, (int)_read);
_writer.Flush();
_index += _read;
_read = _reader.GetChars(0, _index, _chbuff, 0, BUFF_SIZE);
}
}
|
|
|
|
|
Use pre tags. Where does the error happen? What are the data types?
I've never heard of someone trying to do what you're trying to do; it looks weird.
|
|
|
|
|
Say I have two datagridviews (DG1, DG2) each with its own contextmenu, (Menu1,Menu2). Menu1 has menu items Save,Delete,Print and Menu2 has Save,Delete,Print now I would like to make one function that looks like
private void Context_Menu_Save(object sender, EventArgs e){
DataGridView DG = (DataGridView)sender;
}
and then do what I need to do.
The problem is that sender is the menuitem not the Datagridview that menuitem is associated with, so how do I find out which DataGridView's context menu was selected?
|
|
|
|
|
Here are a couple of ways to overcome your problem:
1. the MenuItem belongs to some top-level menu, use its Parent property to find that top-level menu (the ContextMenu might be hierarchical); once you found the ContextMenu, that one has a SourceControl property which will point to the Control on which you right-clicked.
2. you could use the Tag property of the MenuItem and store something there, e.g. the underlying Control.
3. you could set up a dictionary that maps MenuItems to Controls.
4. you could organize a class member "lastDataGridViewClicked" and set it in the MouseDown handler of all DGVs.
#1 requires no set-up effort, it does need a loop to cope with hierarchical menus though.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
Did you check the EventArgs? Sometimes they stuff things in like the OriginalSource, etc. Besides, how are you throwing up the context menu?
|
|
|
|
|
Yes I looked in the eventargs didn't see anything in there either.
And I'm throwing up the context menu via right click. (Not sure if that is what your asking)
But I solved the problem by using the Tag property as suggested earlier.
|
|
|
|
|
Try this:
ToolStripMenuItem itm = sender as ToolStripMenuItem;
if (itm != null)
{
ContextMenuStrip cm = (ContextMenuStrip)itm.Owner;
MessageBox.Show(cm.SourceControl.ToString());
}
Obviously I'm only showing the control in a MessageBox . You can do whatever you need to with it.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
I wouldn't let CG touch my Abacus!
When you're wrestling a gorilla, you don't stop when you're tired, you stop when the gorilla is.
|
|
|
|
|
hi
i made message-box -> a form that has label for message and label for title
and OK button (do nothing).
i can rise this message from any form in my program.
i need message-box that has yes button and no button, and to know
if it pressed yes or no
how to do it ?
can i get any sample code for this ?
|
|
|
|
|
|
A dialog (i.e. a Form shown with ShowDialog) will close and return a DialogResult once one of its buttons is clicked, provided that button has its DialogResult set to something other than DialogResult.None, so use Visual Designer or your own code to assign dialog results to the buttons that should close the dialog, and capture the ShowDialog()'s return value.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
hi guies
i want program to draw and send this drawing to any one
in chatting program by c# with gdi+ technique
|
|
|
|
|
That's nice.
Please read this[^]
If you have a problem and need help then ask, don't just ask for code.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|