|
|
Hello,
I'm trying to get all images out of the projects resource file dynamically. I tried it with the System.Resources.ResourceManager class but it will not work! Can someone help me please or does someone have another idea how to get this work properly?
Thx,
Thomas
|
|
|
|
|
Post your code, maybe it needs some modifications...
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
Hi,
thanks for your answer. I did some research and now have a simple but stupid solution:
ResourceManager rm = new ResourceManager("ImageLoader.Properties.Resources", System.Reflection.Assembly.GetExecutingAssembly());<br />
<br />
CultureInfo resourceCulture = new CultureInfo("de-AT");<br />
ResourceSet rs = rm.GetResourceSet(resourceCulture, true, true);<br />
<br />
IDictionaryEnumerator id = rs.GetEnumerator();<br />
<br />
ImageList il = new ImageList();<br />
<br />
while (id.MoveNext())<br />
il.Images.Add((Bitmap)id.Value);<br />
<br />
rs.Close();
|
|
|
|
|
I am trying to make a program that kan simulate a keypress on the keyboard. I've tried to use sendkeys and it seem to work fine as long as i stay in a nativ Windows environment.
So what i want to do is to be able to insert a key directly in the keyboard input stream so that i can simulate a keystroke without typing on the keyboard but instead activate it by some other means (like voice or mouseclick).
|
|
|
|
|
|
I am using a windows form datagrid and a datatable is used as the datasource.I want to prevent deletion of the first row.I tried with datatable's rowdeleting event.But i was not able to reject the changes.Can any one help.I'm pasting the code that i tried
Private Sub DataTable_RowDeleting(ByVal sender As System.Object, ByVal e As System.Data.DataRowChangeEventArgs)
If e.Action = DataRowAction.Delete Then
If dgGrid.CurrentCell.RowNumber = 0 Then
e.Row.RejectChanges()
CType(sender, DataTable).AcceptChanges()
End If
Else
e.Row.AcceptChanges()
End If
End Sub
Anup Balakrishnan
|
|
|
|
|
In order to solve the problem I had to ctreate my own DataGrid:
public class CustomDataGrid : System.Windows.Forms.DataGrid {
public CustomDataGrid() {}
public bool bAllowDeleteRows {
get { return m_bAllowDeleteRows; }
set { m_bAllowDeleteRows = value; }
}
public override bool PreProcessMessage(ref System.Windows.Forms.Message msg) {
Keys oKeyCode = (Keys)(msg.WParam.ToInt32() & (int)Keys.KeyCode);
if ((oKeyCode == Keys.Delete) & (msg.Msg == 0x100) & !m_bAllowDeleteRows){
MessageBox.Show ( "Rows deletion is not allowed" );
return true;
}
return base.PreProcessMessage (ref msg);
}
protected override bool ProcessDialogKey(Keys keyData) {
if (keyData == Keys.Delete && this.IsSelected ( this.CurrentRowIndex ) && !m_bAllowDeleteRows ){
MessageBox.Show ( "Rows deletion is not allowed" );
return true;
}
return base.ProcessDialogKey (keyData);
}
private bool m_bAllowDeleteRows = true;
Overitten functions prevent deleting row when a user click on delete.
|
|
|
|
|
Can you help me how this can be impleted in my project.This is very urgent for me.Waiting for response.
|
|
|
|
|
I didn't see your code but you need to do the following:
1) Create a new custom DataGrid using the code from the previous message
2) Change all instances of DataGrid in your code to a new CustomDataGrid
3) Set bAllowDeleteRows property of a CustomDataGrid to true
That's all you need to do...
|
|
|
|
|
... I receive this error :
"bla bla bla on Local Computer started and then stopped. Some services stop automatically if they have no work to do, for example, the Performance Logs and Alerts service."
It worked fine before I used some calls to JMail COM-object ...
I Removed the email-functionallity and then it started again.
Do I have a credentials-problem or what?
Please help!
//Maw
|
|
|
|
|
It seems that your email code throws an exception, effectively stopping your service just like an application crash.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi Dave ...
Got any suggestions? The JMail works when I use it in debug. I use a 3 projects to debug this service.
1. Coreclass (contains Functions for Start and Stop
2. Service (Only when doing a release. Use Core as reference. OnStart Calls Core.Start etv)
3. TestApp (My testappliacation. Use Core as reference. Has 2 buttons wich calls Core.Start and Core.Stop)
If I use TestApp then I have no problems. When I compile service I get all this problem.
Can I debug my service in any way? I write errors to Event-log but nothing gets there.
Thnaks // Maw
|
|
|
|
|
|
Did the forum "eat" your code or something? Becouse I really don't understand what you mean...
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
how to get items count OF an Enumaration?
-- modified at 8:34 Tuesday 17th January, 2006
|
|
|
|
|
|
It is clear.
Imagine an enumaration
Enum Crypt
ASD = 1
SDE = 3
DFR = 6
RTE = 9
TEL = 12
MGJ = 17
EIV = 23
... .
End Enum
I need items count of Enum
for example any property like Crypt.Count
if there is no way i will write my own class.
|
|
|
|
|
It's easy - use Enum class
<br />
public enum MyType<br />
{<br />
First,<br />
Second,<br />
Third,<br />
Fourth<br />
};<br />
<br />
Then you can retrive number of items in this way:
<br />
int numOfEnumItems = Enum.GetValues(typeof(MyType)).Length<br />
DevIntelligence.com - My blog for .Net Developers
-- modified at 8:26 Tuesday 17th January, 2006
|
|
|
|
|
Thank you for your help
|
|
|
|
|
It wasn't clear at all, i assume you are after the number of options in a specified enumeration??
string[] enumCount = System.Enum.GetNames(typeof(myEnum));
MessageBox.Show(enumCount.Length.ToString());
That should give you what i think you're after.
Cheers
Kev
|
|
|
|
|
Type it correctly and it would have been clear.
ie/ change or to of
|
|
|
|
|
I want to incorporate DHL / UPS Shipment Tracker in my Web Site. Kindly help me if some one had tried this. Or provide me any information. Your help will be highly appreciated
Cheers
Kashif Ali
|
|
|
|
|
You'll have to ask UPS and DHL for support about this. You can start by clicking and reading this[^].
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi all, how i can retrieve the sql type of a field if i have the system type; for example how i can convert system.string in varchar?
Regards
|
|
|
|