|
Thats mint. Just what I needed.
Thanks to both of you.
|
|
|
|
|
I want to communicate between two forms one is written by me and other is already written by someone but i have executable file only.
I want to extract data from the Textbox of other form not developed by me
My form is in C# 2.0 and the other is where as i think is written VB6.0. I will appriciate if anyone can provide me an example
thanks
|
|
|
|
|
|
Sorry but i am not able to do it.
Can i have an example of getting text from another application form running as separate process
If so please help me and I'll be very thankful to you if you provide me a C# 2003/2005 project
I will be waiting for your reply
|
|
|
|
|
I can't do it for you but I have given you enough keywords for you to search and explore. There are several articles at codeproject that show how to do it.
|
|
|
|
|
So you are voting one because I didn't do your work? This will not encourage any member to help you
|
|
|
|
|
I am sorry i hurt you but i was not intended to do so
I just vote the material is not helping but i appreciate your consideration for intime and first reply
Thanks a lot
Again i will say sorry
|
|
|
|
|
I current can crop certain part of the colour image using
Rectangle rect = new Rectangle(btmX, btmY, rectWidth, rectHeight);
//reading image to graphics
Graphics g = Graphics.FromImage(selectedImg);
//drawing with red pen width 1
Pen pen = new Pen(Color.Red, 1);
//e.Graphics.DrawRectangle(pen, rect);
//drawing the rectangle here
g.DrawRectangle(pen, rect);
picBoxOpen.Image = selectedImg;
//g.Dispose();
but once i crop a grayscaled Image it gave me this problem
+ $exception {"A Graphics object cannot be created from an image that has an indexed pixel format."} System.Exception
I'm kind of new in this image processing area can any kind souls help me out with this please :P thanks
|
|
|
|
|
Cropping an image is one thing... but why are you drawing a red rectangle on the image? From what I can see, the usage of a color outside of the image's pallette range is what is causing your current error, but I certainly cannot see from first glance why you are even using it.
|
|
|
|
|
Oh, cause my program I want to enable a selection for users, using mouse down and mouse up event for users to select the part they wanan crop and a rectangle will be drawn once they selected the part to crop
|
|
|
|
|
What the meaning os this code:
string string1;
string string2=string1.TrimEnd( new char[0]);
Thanks
|
|
|
|
|
It trims the null(s) off the end of string1.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
|
The expression new char[0] creates a new array of characters with the length zero.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Ashfield wrote: It trims the null(s) off the end of string1.
Not really. It trims white space characters off the end of the string.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
If you have something like this:
char[] trim = { 'o', 'a' };
textBox1.Text = "Hellooooo".TrimEnd(trim[0]);
TrimEnd will remove all 'o's from the end of your string, if you try to use TrimEnd like this:
textBox1.Text = "Hellooooo ".TrimEnd(new char[0]);
char[0] means whitespace and TrimEnd will remove all whitespaces from the end.
When you're alone in the Dark, Fear will protect you...
|
|
|
|
|
If you call the TrimEnd method with an empty array, it will remove all white space characters from the end of the string.
This is a special case, that is not covered in the documentation. I have sent a message to Microsoft about it.
Update:
I got a reply from Microsoft, and they have updated the documentation.
Despite everything, the person most likely to be fooling you next is yourself.
modified on Thursday, November 6, 2008 6:33 AM
|
|
|
|
|
I have a checkbox field in the datagridview control as column 1 called "Select" as the name of the column.
When the user selects this checkbox for any row, I would like to run some code and based on an if statement to set this checkbox to false.
I am running this as follows but the checkbox is set to true i.e checked and can not change it to unchecked.
What am I doing wrong please?
private void dgv_CellClick(object sender, DataGridViewCellEventArgs e)
{
if (e.ColumnIndex >= 0)
{
if (dgv.Columns[e.ColumnIndex].Name.ToLower() == "select")
{
int intSecuritySetting = Convert.ToInt32(dgv.Rows[e.RowIndex].Cells["SecuritySetting"].Value);
if (intSecuritySetting == 0)
{
//Make sure the security check is set to false...
dgv.Rows[e.RowIndex].Cells["Select"].Value = CheckState.Unchecked;
}
}
}
}
modified on Wednesday, November 5, 2008 4:06 AM
|
|
|
|
|
Hi arkiboys,
int intSecuritySetting = Convert.ToInt32(dgv.Rows[e.RowIndex].Cells["SecuritySetting"].Value);
.Cells should be the int value instead of string
example:
int intSecuritySetting = Convert.ToInt32(dgv.Rows[e.RowIndex].Cells[e.ColumnIndex].Value
or
int intSecuritySetting = Convert.ToInt32(dgv.Rows[e.RowIndex].Cells[1].Value
hope this help
|
|
|
|
|
The value property gets updated after the cell click event and cellcontentclick event(atleast in the sample code I had written). Hence even if I change the checked state, it will again get changed. I wrote the same code in cellvaluechanged event and it works. Hope this helps.
|
|
|
|
|
Hi.
I'd like to know how to generate/create a specific number of components - buttons. The user would give out the number of buttons.
Every button should have its own working onclick code. And i could manipulate with every one of them whenever i want.
The creating part is partly know to me... but dont know how to control and rename them to get control for example ...
Button1 and button2 when i have buttons from 1-10.
Button1.Text="blah blah";
Button2.Text="the second butt.";
button3.Text="smthn";
etc.
Im really sorry if i have so many newbie questions but its just he way i am. Stil learning.
If there are any answers - i thank you for them
Have a nice day,
Matjaž
Força Barça!
|
|
|
|
|
hi,
Use for loop to create the button and add eventhandler for each button you create.Below is a sample:
{
InitializeComponent();
this.Load += new EventHandler(Form1_Load);
}
private void Form1_Load(object sender, EventArgs e)
{
Button[] b = new Button[3];
for (int i = 0; i < 3; i++)
{
b[i] = new Button();
b[i].Name = i.ToString();
b[i].Click +=new EventHandler(Form1_Click);
b[i].Location = new Point(i * 10, i * 10);
}
this.Controls.AddRange(b);
}
private void Form1_Click(object sender, EventArgs e)
{
Button b = (Button)sender;
Console.WriteLine(b.Name);
}
Hope this help
|
|
|
|
|
max00slo wrote: The user would give out the number of buttons.
void CreateButtons(int num)
{
Button[] button = new Button[num];
for (int i = 0; i < num; i++)
{
button[i].Click += new EventHandler(Buttons_Click);
this.Controls.Add(button[i]);
}
}
max00slo wrote: Every button should have its own working onclick code
void Buttons_Click (object sender, EventArgs e)
{
Button b = sender as Button;
switch (b.Name)
{
}
}
Hope I could understand you and could help
When you're alone in the Dark, Fear will protect you...
|
|
|
|
|
Nice explain
|
|
|
|
|
Thank you
When you're alone in the Dark, Fear will protect you...
|
|
|
|