|
I almost forget.
The following code shows how to change the language programmatically
System.Globalization.CultureInfo culture =
new System.Globalization.CultureInfo( "fr" );
System.Threading.Thread.CurrentThread.CurrentUICulture = culture;
where fr is a language code ( see MSDN ).
43 68 65 65 72 73 2c
4d 69 63 68 61 65 6c
|
|
|
|
|
i just want to mention, that using the form-editor was a BAD idea.
my menuitems are objects of my own menuitem-class - after just changing the language in the properties-window, the menu completely vanished. setting the language back to 'default' didn't bring it back! the variables are still there, but the AddRange-functions of the main menu items were absent. ok, i added them by hand. fault! the form-designer showed me an error-message instead of the form-preview.
i corrected these things by changing the order of the variable-definitions (!!!) - but the designer now doesn't work, as he did before. the additional properties of my menuitems are set back each time i compile after using the form-designer...
i tell you: you better stick to the standards when using the form-designer.
i will do that all by hand from now on...
:wq
|
|
|
|
|
The globalization function is cool.
The C# designer seems not to work correctly with custom classes, for example Menu.
I use globalization but I don't use designer. I write my own code.
This code use Carlos H. Perez's library - designer is not supported.
There is only one minus of it. You must create the resources yourself using resgen.exe and al.exe
private System.Resources.ResourceManager m_mResources = new System.Resources.ResourceManager(typeof(MainForm));
ToolBarEx menuToolBar = new ToolBarEx( BarType.MenuBar );
ToolBarItem menuFile = new ToolBarItem( (string)(m_mResources.GetObject("Menu.File")) );
MenuItem[] submenuFile = new MenuItem[3];
submenuFile[0] = new MenuItemEx( (string)(m_mResources.GetObject(
"Menu.File.Options")), new EventHandler( OptionsHandler ), Shortcut.CtrlO );
submenuFile[1] = new MenuItemEx( "-", null );
submenuFile[2] = new MenuItemEx( (string)(m_mResources.GetObject(
"Menu.File.Close")), new EventHandler( CloseHandler ) );
menuFile.MenuItems = submenuFile;
43 68 65 65 72 73 2c
4d 69 63 68 61 65 6c
|
|
|
|
|
I can not close the window with X on the window(System close)
Can anyone help me with that?
Thanks![Confused | :confused:](https://codeproject.freetls.fastly.net/script/Forums/Images/smiley_confused.gif)
|
|
|
|
|
what functions did you overwrite in your application?
:wq
|
|
|
|
|
I did not over write any function?
![Confused | :confused:](https://codeproject.freetls.fastly.net/script/Forums/Images/smiley_confused.gif)
|
|
|
|
|
in the case, it doesn't close when you click - does it close when you click a second time?
maybe it's a focus-problem (although windows are closed when you click the "x" and they don't have the focus...)
:wq
|
|
|
|
|
I can not close at all.
but If I create a Exit menu and put "Dispose(true);" then I can close the window.
X is not calling the Dispose(true) methode at all.
Thasnks![Confused | :confused:](https://codeproject.freetls.fastly.net/script/Forums/Images/smiley_confused.gif)
|
|
|
|
|
If you want to build a COM server component using Visual C#, which project type do you choose in the "New project" window?
|
|
|
|
|
Anything will do. You can use EXE or a DLL. You need to apply the correct attributes and register the assembly using regasm
|
|
|
|
|
May be I am stupid, But what are you talking about.
Sometime I can close my main window and some time I can not close the window with system menu. Are you talking about this?
Thanks
![Eek! | :eek:](https://codeproject.freetls.fastly.net/script/Forums/Images/smiley_eek.gif)
|
|
|
|
|
I did not answer to your question
Looks like the forum is screwed up
|
|
|
|
|
hello you all,
I have a problem:
I have a dataGrid with two events:
1. public void DataGrid1_ChooseLine(object sender, DataGridCommandEventArgs e)
{
try{
complaintId = Convert.ToInt32(e.Item.Cells[6].Text);
}
catch(Exception e)
{
}
}
and:
2. public void changePage(Object sender, DataGridPageChangedEventArgs e)
{
DataGrid1.CurrentPageIndex = e.NewPageIndex;
DataGrid1.DataSource = dataSet;
DataGrid1.DataBind();
}
each of them works wonderful alone, but when I use them both I get this exception:
"System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values..."
what can be the problem and how can I change it to work?
thank you very much for your help,
sharon.
|
|
|
|
|
after some debugging I noticed that when I change page it goes to the ChooseLine event and than go to the pageChang event (very weird)
maybe someone knowes why?
|
|
|
|
|
usually the debugger tells you, in which line exactly the exception was thrown. which line is it?
:wq
|
|
|
|
|
the line that debugger tells me is:
complaintId = Convert.ToInt32(e.Item.Cells[6].Text);
in chooseLine event
i.e. he goes to the wrong event.
why???
|
|
|
|
|
well, the cell-array doesn't seem to have 7 elements - thus cell[6] rises the Out-Of-Range-Exception.
:wq
|
|
|
|
|
hi all,
when i put a bitmap on a button and disable the control, the image is painted in a smooth gray-scale way.
is there any chance to access the corresponding
Image MakeMyImageGrayScale(Image my Image); function directly, giving it the colored image and getting back the grayscaled one?
or is the algorithm easy, so that someone can describe it here in the forum or knows a link to a description? if someone tells me how, i would do that myself.
would be
thx in advance
:wq
|
|
|
|
|
ok, i wrote my own:
Image ImageToGrayScale(Image orig)
{
Bitmap bm = new Bitmap(orig);
for (int i=0; i<bm.Width; ++i)
for (int j=0; j<bm.Height; ++j)
{
Color pixel = bm.GetPixel(i,j);
if (pixel.A>0)
{
int grayVal = 175+(pixel.R+pixel.G+pixel.B)/12;
bm.SetPixel(i,j,Color.FromArgb(grayVal,grayVal,grayVal));
}
}
return bm;
}
:wq
|
|
|
|
|
Hello friends,
In my application i want to add favourites from Internet Explorer as well as Netscape.
I dont want to take favourite folder path from user.I want to get that folder path dynamically using C#.
Has anyone tried this out?
Thanks in advance.
Pranoti
|
|
|
|
|
I think if you use the environment class and get the APPDATA environment variable, that will point you to the correct location.
|
|
|
|
|
Hi,
I'm trying to write a service that exposes a remote object through a channel. I also want a 'management console' application that allows me to configure the service remotely. Again, I expose a remote object. Now comes the tricky part:
When a client instantiates a remote object and the service manager is 'connected' through the other type of remote object, I want to send events (messages) from the client object, through the manager object to the manager app. On the manager PC I would like to have a real time log for all clients connected to a server.
Any help is highly appreciated,
G
By the way anyone knows if the .Net CF and SDE supports remoting? Got it, but didn't install it yet...
Any idea when a new release can be expected?
|
|
|
|
|
HG,
I'm not sure I followed your question, but I'll make a hack at it. I think you will need to basically have your middle object echo the method (event) back to the manager application. There is no such thing as a 'pass through method' if that's what you are asking.
As far as .Net CF, Remoting is NOT supported. I was VERY upset to learn this myself, although I understand the size limitations. CF does support web services, however, which means you can at least do semi-remoting one-way. I don't think there is any way to receive events from a web service though. Soemone correct me if I'm wrong. One last note, even though web services are supported, ISerializable seems to be missing from the CF. Anyone know where that went?
Jared Bienz
jbienz@hotmail.com
|
|
|
|
|
I found an MSDN article that demonstrated how to call SHGetFileInfo (using InterOperability services) to retrieve system icons. I am in the process of building a kind of management class (manages a large and small imagelist, and retains a list of extensions already handled etc.) with the eventual aim of putting it all up here for others to use in their C# apps.
However, it doesn't like the new XP icons with alpha channels. (as far as I can make out).
When you retrieve the icon for an Excel spreadsheet it looks fine, same for Word etc. However, if you add a text file, the notepad icon appears but with a black border around the edge, this is also true when retrieving folder icons.
I've found some examples of people producing MFC classes to retrieve icons and they work fine so I'm guessing its something I've mashed myself.
Does anybody know what might be causing this to happen?
The code looks like:
Shell32.SHGetFileInfo( name, Shell32.FILE_ATTRIBUTE_NORMAL, ref shfi, (uint) System.Runtime.InteropServices.Marshal.SizeOf(shfi), flags );
System.Drawing.Icon icon = (System.Drawing.Icon)System.Drawing.Icon.FromHandle(shfi.hIcon).Clone();
The icon is cloned so that DestroyIcon can be called to remove the handle -- since I'm adding it to an imagelist DestroyIcon can be called as soon as its been added, however a clone must be made so as not to make the reference to the icon invalid.
If anyone has any suggestions as to how I might sort this out I'd very much appreciate it.
Regards,
Paul
|
|
|
|
|
Paul,
As far as I can tell, the black border is a .Net Framework problem. In my article just posted yesterday, I too retreive this icons. I am dealing with disk drive icons, but I obtain them the same way. In my other article also posted yesterday, I show a control that uses these system icons. The way that I get around the black borders is to resize the image. In my control, I use the 32x32 image and resize it to 16x16 using a soft resampling. That actually works quite nicely. If you need the 32x32, I'm not sure I can help much unless upsampling and then downsampling/averaging works there too. I sure can't tell you why the bug is there...
Hope that helps a little.
Jared Bienz
jbienz@hotmail.com
|
|
|
|