|
Thank you very much
I say that because the only working instance of Graphics I found was through a form, such as using it to draw lines on a form.
|
|
|
|
|
Ah, sure, because in the paint event, it's been created for you.
A lot of .NET classes use static factory methods instead of constructors, that's always something that's good to look for, in that scenario.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hello comrades !!! I need your help. Here is what we have:
We have a jpg image that contains gray background and a lot of white eggs on it. We need to get the number of eggs and the size of each eggs. (i think in pixels).
How can i do it ?
The hardest problem is to get the whole egg (To mark the edges) and smart divide screen into some parts, for easiest count.
Thanks for help.
One nation - underground
|
|
|
|
|
Sounds like a school question. You'll never learn by immediately hoping on the forums and asking such a broad question. Instead start writing code and when you hit smaller stumbling blocks along the way, then we can help!
|
|
|
|
|
Interesting problem. Probably a lot easier than you think, however. Start with my image processing articles, for how to access the pixels of a bitmap. Then, just think it through.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hello!
I have a question: I want to send signals from my pc to a µC via Ethernet!
PC sends signal via ethernet to a ethernet/RS232 changer and then to the µC!
I have problems to understand how to speak with the changer...
What should I look for?
Had someone the problem before?
Thanks!
|
|
|
|
|
Your only hope is documentation on the RS232/Ethernet changer or an SDK. Your single best source of information would be the manufacturer of the device. This is so non-standard, it's very unlikely you'll find someone who has done it.
|
|
|
|
|
Hi,
basically an Ethernet-to-RS232C converter consists of a cable and a driver
(same is true for a USB-to-RS232C converter).
when installed properly the cable+driver turn the new RS232C plug into a regular serial
interface; you should be able to see it in the list of available ports, e.g. in a terminal
emulator program such as HyperTerminal.
And you should also be able to use the SerialPort class to access that serial port in
exactly the same way you would access a regular serial port (assuming your PC still has one).
The conclusion is: you never "speak" to your converter, its driver makes it fully transparant.
Hope this helps.
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Hmmm...I've never heard of these little things, and frankly, can only think of a couple of reasons to even use one.
Learn somet'in new every day...
|
|
|
|
|
Hi!
What is the best way of determining the TopMost and BottomMost visible rows in the datagrid (.NET 1.1)
Thanks
|
|
|
|
|
Hi,
I have a TextBox, and DataGrid on a form. TextBox has the focus, by pressing the PageDown key while in TextBox, I want the DataGrid to perform the PageDown functionality.
I know that I have to use SendMessage method, I am just no sure what parameters I have to pass for the Pagedown handler.
Any ideas?
Thank you.
|
|
|
|
|
For simplicities sake I have extracted the following example from a larger app.
I have a simple form that has a listBox (L1) and two textBoxes (T1 & T2) and a submit button (B1). I have created a dataset(D1) that currently only has one table(T1) in it. I use VS's designer to bind the contents of T1 to L1. I then use the Databindings properties of the textBoxes to respectively bind one of the columns of the table (T1) to each. This works fine. It allows me to select an item from L1 and the text in the textboxes change to reflect their respective columns.
Now I added a function to hadle the SelectedIndexChanged event of L1. For the sake of simplicity I just put a MessageBox in the function. When I change the text in one of the textboxes then click the B1 button I have a function that ends the current edit and updates the tableAdapter. The value gets updated in the db. Then something unexpected happens after the update. The SelectedIndexChanged event fires once for every row in DS.T1 (Maybe as the listBox refreshes). Should this happen? I thought the SelectedIndexChanged event only fired when a user clicks on an item in the listbox.
How can I get the SelectedIndexChanged event to only fire when an item in the listbox is clicked?
BTW - I am using VS2008b2
-Kevin
-- modified at 16:11 Wednesday 12th September, 2007
|
|
|
|
|
the question are:
i add this into a listview
string ett = "1";
string u = comboBox1.Text;
string q = textBox1.Text;
string w = textBox2.Text;
DateTime dt = DateTime.Now;
if (q.Length > 0 && w.Length > 0 && u.Length > 0)
{
if (this != null)
{
string time = dt.ToString("dd");
string name = this.textBox1.Text + time.ToString() + ett;
ListViewItem item = new ListViewItem(new string[] { u, name, dt.ToString(), this.textBox2.Text });
ListViewIns.Items.Add(item);
But string u and name can not be equal with something else in a .txt file
for example
string u = Online
name = k431121
And the .txt file look like this:
#
online
k431121
blah
blah
If they two string match with line[index +1] an line[index +2] then add +1 on k431121. So in this example they match it will add +1 and look like this
#
online
k431121
blah
blah
#
online
k431122
blah
blah
I have a code but it don´t want to work:
private List<string> Entries;
private void LoadEntries()
{
string key;
Entries=new List<string>();
foreach (ListViewItem item in listView1.Items)
{
key = string.Concat(item.SubItems[0], "@@", item.SubItems[1]);
if (!Entries.Contains(key))
Entries.Add(key);
}
}
private void PopulateListView(List<string> list)
{
LoadEntries();
listView1.View = View.Details;
listView1.Columns.Add("Kolumn1");
listView1.Columns.Add("Kolumn2");
listView1.Columns.Add("Kolumn3");
listView1.Columns.Add("Kolumn4");
listView1.Columns.Add("Kolumn5");
string Name,No,key;
int n;
for (int i = 0; i < list.Count; i += 5)
{
Name = list[i+1];
No = list[i + 2];
while(Entries.Contains(key = string.Concat(Name, "@@", No)))
{
n = Convert.ToInt32(No.Substring(No.Length - 1));
No = String.Concat(No.Substring(0, No.Length - 1), n + 1);
}
if (!Entries.Contains(key))
Entries.Add(key);
ListViewItem item = new ListViewItem(list[i]);
item.SubItems.Add(Name);
item.SubItems.Add(No);
item.SubItems.Add(list[i + 3]);
item.SubItems.Add(list[i + 4]);
listView1.Items.Add(item);
}
}
My question is: can you help me build this together..???
Thanks////
|
|
|
|
|
Can somebody give me a sample of GridView update? I dont want to update each row. Instead, I want to store all updates on the client side(using datatable)
and update the entire gridview checking if the records are different from the existing database. For update command, am using SQL stored proc.
Please give me a sample.
Thanks
|
|
|
|
|
You can use TableAdapter.Fill() Method to update DataGridView, assuming that DataGridView is bound to dataset, and it has BindingSource and TableAdapter.
|
|
|
|
|
as the subject,
I want to add hyperlink to datagridview column, the link can download pdf file, like IE effect.
looks a little bit hard?
if can leave me a demo code to download is a prefer.
god bless me,
tomorrow is my task deadline.
thanks a lot,
James Liu
|
|
|
|
|
liujw wrote: I want to add hyperlink to datagridview column, the link can download pdf file, like IE effect.
DataGridViewLinkColumn, DataGridViewLinkCell are the types you should look into.
liujw wrote: god bless me,
tomorrow is my task deadline.
That's a great quote.
|
|
|
|
|
Yeah, that question was worth a '5'
liujw wrote: tomorrow is my task deadline
liujw wrote: if can leave me a demo code to download is a prefer.
"More functions should disregard input values and just return 12. It would make life easier." - comment posted on WTF
"I haven't spoken to my wife now for 48 hours. I don't like to interrupt her.
|
|
|
|
|
Hi Everyone
I need a help, i have a number for eg :- 9.5 i want it to be 9.05 while taking to database cause if use round of it will give 9.50 but i want 9.05. am using C# 2005.
Thanks In Advance
|
|
|
|
|
rowdykuttan wrote:
I need a help, i have a number for eg :- 9.5 i want it to be 9.05 while taking to database cause if use round of it will give 9.50 but i want 9.05. am using C# 2005.
Can you rephrase what you are trying to accomplish? Not sure I follow.
It isn't enough to do well in life.
One must do good when and where one can.
Otherwise, what's the point?
|
|
|
|
|
It seems that he wants to redefine how mathematics works.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
|
Pete O`Hanlon wrote: It seems that he wants to redefine how mathematics works.
Thanks for the chuckle - that might just be the case.
I wanted to give the author the benefit that it might just be a language issue, though.
It isn't enough to do well in life.
One must do good when and where one can.
Otherwise, what's the point?
|
|
|
|
|
double answer;
if(dbNumber == 9.5)
{
answer = 9.05;
return answer;
}
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
The people in the lounge said I should google for the answer to a programming question but I do not know what search engine to use
|
|
|
|
|
ROTFL !!!!
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|