|
Following points may help
(1) Please Subclass the TextBox displayed.
(2) Override the PreProcessMessage and Fire a custom event on the -> (right arrow event).
(3) Subscribe to this event in the ListView. In this method just change the focus to the next TextBox.
Live Life King Size
Alomgir Miah
|
|
|
|
|
I create a datatable with 3 columns at run time and set it to a Datagrid. Datagrid has 5 extended columns. for example one is numeric column, other is a date time picker, other is button.
I aim to create as a form like EXCEL but with special columns.
I add a row to datatable after creating. I want to add others when the user fills all fields or press down key.
I couldnt achive yet, there is always problem, Could u advise another method to do that?
|
|
|
|
|
o buy a third party datagrid library that isn't as brain dead as the built-in version.
o look at some of the nicer controls on this site (http://www.codeproject.com/cs/miscctrl/csharpgridcontrol.asp[^])
o waste many hours of your life researching the functionality of the builtin datagrid, determine that it sucks, and end up doing one of the above two things anyway.
|
|
|
|
|
I extended datagridtextboxcolumn class. When u click f5 button a special calculator form is opened as modal form. But when u close the calculator presssing OK button there is no problem; if u press cancel the focus is lost. Why does it cause?
|
|
|
|
|
Hi
I am looking for the fastest way of URL's encryption and decryption .
Can anyone suggest a way?
|
|
|
|
|
Please don't double post.
If you really really think that you have to draw attention to your question in more than one board, keep the question in one board, and post a link to it in the other.
---
b { font-weight: normal; }
|
|
|
|
|
hai hello
i use one kodak image edit control in c# program
how we zoom the image and rotate the image
and also display annotation toolbar
if any body known.Please tell me the solution
the following code is not working
aximgEdit1.zoom=aximgEdit1.zoom+10;
aximgEdit1.Refresh();
aximgEdit1.RotateAll(100);
article for c#
|
|
|
|
|
Hi,
basically i am new for using Kodak image edit tool in asp.net.
i just want to know from where i can download or get Kodak image edit control and how to use it in asp.net, please if you are get my question than explain me usage of image edit control and also give demo code for it if its possible.
Thanks
|
|
|
|
|
Hi Everyone,
I am working on DataGrid. Actually I have relationship between two table(Customers and orders) and
displaying on DataGrid. I want to update a record of orders table when I click or select on datagrid,
all the records of order table goes to Textbox control one by one then I or user can update the table easily.
Thanks
|
|
|
|
|
Hi Im in need to plot graph of some math functions.Any hint how can I do this in C#?Thank you
|
|
|
|
|
The Graphics object gives you all the methods you need to draw onto a Bitmap. Check MSDN for more info. You should draw it to the screen in your OnPaint handler, and call Invalidate for force a redraw when it changes.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I need some help understanding basic c# layout regarding constant declarations. I have some global constants I'd like to declare for my windows.form based app such as:
const int APPLICATION_STATE_PAUSED = 0;
const int APPLICATION_STATE_RUNNING = 1;
etc...
Where is the correct place to declare these so they will be accessable by all forms and classes in my project?
Thanks - mutty
|
|
|
|
|
The only way to make them globally visible is to create a class that has them as public static members. There is no global scope in C#. Personally, I think this looks like C code, I'd ditch the all caps syntax, and maybe even use an enum instead.
const is only good for compile time values, for run time values, they need to have class scope, and be declared in the constructor, and they need to be readonly, not const.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Where would I put the enum to make it globally visible?
|
|
|
|
|
Same again, there is no such thing as globally visible, excepting public and static on a class that you use to hold this sort of stuff. Or just outside any class, if they all have the same namespace.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Anywhere you want outside a class declaration.
|
|
|
|
|
Create a struct that has static accessors to the constants you want to define. Such as:
public struct Aprori
{
static public int Running
{
get { return _Running; }
}
private const int _Running = 5;
}
...
Then access it by
int x = Aprori.Running;
That way you have one object that contains your constants and is easily accessed. If you have differing constants you can group them in other structs for similar purpose.
|
|
|
|
|
I'm trying to write a small program (just for experience) that I can use to change my desktop wallpaper, but I can't see to get it right. I'm using the following code:
Bitmap img = new Bitmap (path);
try
{
img.Save (path, System.Drawing.Imaging.ImageFormat.Bmp);
SystemParametersInfo (0X14, 0, path, 0X1 | 0X2);
}
catch (Exception ex)
{
MessageBox.Show ("There was an error setting the wallpaper: " + ex.Message);
} path is the path to the image file which is currently in jpg format. When the img.Save line executes it throws an exception that says simply, and quite unhelpfully, "A generic error occured in GDI+". Any help on what I'm doing wrong would be appreciated.
Thanks.
- Aaron
|
|
|
|
|
monrobot13 wrote:
Bitmap img = new Bitmap (path);
monrobot13 wrote:
img.Save (path, System.Drawing.Imaging.ImageFormat.Bmp);
Why do you need to save it as a bmp ? Why are you using the same path to save it ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I was under the impression that an image had to be a bitmap to use as the wallpaper...is this not the case? I have no real reason as to why I was using the same path to save it.
- Aaron
|
|
|
|
|
A jpg is also fine. You should perhaps create a new file, and see what happens then. And check first if it's a bmp already. The Path class has static methods to help with this.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I was just testing out the code and the SystemParametersInfo function is changing the background when I pass it the path to a .bmp, but when I pass it a .jpg it just sets the background to nothing (as if "none" were selected in the display options). So I have two questions:
1. Does the SystemParametersInfo function only work with .bmp's and if so is there any other way to change the background?
2. Is there a way to change an image from one type to another? If the answer is as simple as the Image.Save function, but using a path that isn't the current open image (as I was doing before), then forget I asked the question.
Thanks much for the help.
- Aaron
|
|
|
|
|
monrobot13 wrote:
Does the SystemParametersInfo function only work with .bmp's
Looks like it. I think jpgs work via active desktop, so that could be why.
monrobot13 wrote:
If the answer is as simple as the Image.Save function, but using a path that isn't the current open image (as I was doing before), then forget I asked the question.
What question ? :P
Yes, that's how you do it.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
First, thanks for taking the time to help me on this Christian.
Second, I still can't seem to save anything using the Image.Save method. Here's my entire chuck of code, maybe you could help me find what, if anything, I'm doing wrong.
if (lstFiles.SelectedIndex >= 0 && lstFiles.SelectedIndex < lstFiles.Items.Count)
{
string szImgPath = dlgDir.SelectedPath + "\\" + lstFiles.SelectedItem.ToString();
Bitmap dibBkgnd = new Bitmap (szImgPath);
try
{
string szSavePath = @"C:\Documents and Settings\Temp\Incomplete\";
dibBkgnd.Save (szSavePath, System.Drawing.Imaging.ImageFormat.Bmp);
SystemParametersInfo (0x14, 0, szSavePath, 0x1 | 0x2);
dibBkgnd.Dispose ();
}
catch (Exception ex)
{
MessageBox.Show ("There was an error setting the wallpaper: " + ex.Message);
}
} When I run this I'm still getting the same exception ("A generic error occurred in GDI+") thrown on the Save method.
The image is of the jpg format and I'm trying to save it as a bmp so I can set the wallpaper. I also tried changing the ImageFormat to a Jpeg just to see if it was a problem with saving to a different type, but I received the same exception. I also tried having no '\' after Incomplete cause I wasn't sure it was added in in the Save , but again the same exception.
Any and all help you can offer is very appreciated.
- Aaron
|
|
|
|
|
monrobot13 wrote:
First, thanks for taking the time to help me on this Christian.
No worries, it beats working :P
monrobot13 wrote:
string szSavePath = @"C:\Documents and Settings\Temp\Incomplete\"; dibBkgnd.Save (szSavePath, System.Drawing.Imaging.ImageFormat.Bmp);
Well, this can't work. You need to append a file name to the path
Christian Graus - Microsoft MVP - C++
|
|
|
|