|
Pedro S Ferreira wrote:
Is there any workaround for this or should I implement a new generic CollectionBase from scratch?
It looks like you'll need to implement a generic CollectionBase.
Marc
My website
Latest Articles:
Undo/Redo Buffer
Memento Design Pattern
|
|
|
|
|
There's this great article about PropertyGrid control. There is a set of classes PropertBag/PropertySpec in that article to help customize what the grid shows. Ok. Then there's idscussion about how to make comboboxes work. So the suggested way is through the UITypeEditor inhertance. And there I ask a question on how to modify the list of possible values. How to set a list of items in the listbox at "Properties.Add" time in form code instead of the contructor of that ListBoxEditor?
In other words how to get access from the contructor of the ListBoxEditor back to form so I can fill the listbox with dynamic values?
I hope it's not too confusing.
Please help! Urgent! Thanks a lot in advance!
|
|
|
|
|
inner wrote:
In other words how to get access from the contructor of the ListBoxEditor back to form
You need to pass the form in as a parameter if you want access to it from there.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
But that is dynamicaly created by .NET not my code, no?
|
|
|
|
|
inner wrote:
But that is dynamicaly created by .NET not my code, no?
No. The keyword this is a reference to your form class, when inside your form class.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I have been working on a personal project and have been stuck for a few days now.
I am trying to figure out how to use GDI+ to read an image and somehow determine the amount of color used for that image... per color channel (i.e. per R, per G, per B).
I know you can somehow read (not write) CMYK images, so I would like to be able to do both RGB and CMYK images.
If anyone has any solution to this or can provide any direction it would be greatly appreciated. Maybe I can finally get some sleep!
|
|
|
|
|
How do you mean, the amount of colour ? As a percentage by working out the values of all red pixels / (255*width*height), for example ?
If pixel access is your problem, read my image processing articles.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Yes I would like to determine the % of color coverage for a specific base color... i.e. red.
So you are saying that I need to read through each pixel and keep a rolling totatl count of each color I am interested in?
I guess I will need to read your articles. Thanks.
|
|
|
|
|
Can I create the namespace 'mycompany.enet' but span the implementation across multiple cs files?
/// file: server.cs
using mycompany.enet
{
public class CServerThread declaration/implementation;
}
/// file: client.cs
using mycompany.enet
{
public class CClientThread declaration/implementation;
}
Thanks for helping a neophyte with this issue.
|
|
|
|
|
correction to code snippet. Disregard the using keyword. It should read
/// file: server.cs
namespace mycompany.enet
{
public class CServerThread declaration/implementation;
}
/// file: client.cs
namespace mycompany.enet
{
public class CClientThread declaration/implementation;
}
|
|
|
|
|
Yes you can. In fact, namespaces can span assemblies too. For example, the System namespace spans across mscorlib and System.dll. Namespaces represent logical grouping of code and hence are not restricted to a particular file or assembly.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Yes, you can have multiple .cs files all within the same namespace within the same project.
You can also have multiple C# class libraries (DLLs) within the same solution.
Good Luck!
|
|
|
|
|
|
i have a project to show modulations of a wave which is loaded from a bipmap image.and throw it on another wave using amplitude, frequency and phase modulations.
any who can help me out plz contact at
sahil_892@hotmail.com
|
|
|
|
|
So what part do you need help with ? How much have you done ?
And why do people keep posting here with email addresses ? All you'll get from that is spam, no-one's going to help you if you're not willing to read the site.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hello All,
I made database and i used bit type to store the true false but i had error when i trying to parse it with c#
and this the code.
int true = int.pars(Dataset.Table[0].Rows[0].Itemarray[0].tostring());
Please help
hay
|
|
|
|
|
|
Yes i tried it but didnt work too.
Thanks,
Hay
|
|
|
|
|
Hi,
Can you post your code?
(Or send it to me?)
|
|
|
|
|
I have a DataGrid bound to a DataView. The "RowFilter" property changes dynamically based on which item is selected from a comboBox. The "table" property of the DataView does not change. If I just select different items (Employee Names) from the comboBox the the DataGrid displays the appropriate rows pertaining to that particular employee. However, when I modify some of the employees records (im trying to change data that changes the employeeID from a set of selected rows in the DataGrid). Howerver, when I run the code, the correct number of rows get updated, but all not the rows intended. Actually If I choose 5 rows, only two of the rows selected get updated plus 3 more that are higher in the row index. by the way, I consider myself a newbie (at about 40% or less knowledge)
Here are sections code pertaining to this issue.
/////////////////////////////////////////////////////////////////
/ comboBox population and dataGrid dataSource binding to DataView
/////////////////////////////////////////////////////////////////
// If no selection has been made in the comboBox
if(cbTransferFrom.SelectedIndex == -1)
{
// set the "Table" property of the DataView object
da.dvLeads.Table = da.dataSet.Tables["Campaign"];
da.dvLeads.RowFilter = "";
da.dvLeads.Sort = "Status, APID ASC";
}
else
{
// No need to set the "Table" property again,
// just re-set the "RowFilter" property to filter for the desired rows
// hTable is a Hashtable containing the Employee's Name and the corresponding
// EmployeeID
da.dvLeads.RowFilter = "APID = " + hTable[cbTransferFrom.SelectedItem.ToString()];
da.dvLeads.Sort = "Status, APID ASC";
}
dataGrid1.DataSource = da.dvLeads;
/////////////////////////////////////////////////////////////////
/ Selecting Rows from DataGrid
/////////////////////////////////////////////////////////////////
private void dataGrid1_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e)
{
string temp = "";
// indexArray will hold the rowIndex for the row selected so we can know
// which row to modify later
indexArray = new int[da.dvLeads.Count];
for(int i = 0; i < da.dvLeads.Count; i++)
{
if(dataGrid1.IsSelected(i).ToString() == "True")
{
indexArray[itemsCount] = i;
itemsCount++;
temp = temp + "DataView RowIndex: " + i + " Name: " + dataGrid1[i,4].ToString() + " " + dataGrid1[i,5].ToString() + "\n";
}
}
MessageBox.Show(temp);
lblLeadSelected.Text = "Leads Selected: " + itemsCount;
}
/////////////////////////////////////////////////////////////////
/ Modifying the data in the dataView
/////////////////////////////////////////////////////////////////
string temp = "";
// itemsCount is the length of the indexArray
for(int i = 0; i < itemsCount; i++)
{
da.dvLeads[indexArray[i]][1] = hTable[cbTransferTo.SelectedItem.ToString()];
da.dvLeads[indexArray[i]][2] = hTable[cbTransferTo.SelectedItem.ToString()];
ChangeLeadsDisplay();
str = str + "-";
temp = temp + "DataView RowIndex: " + indexArray[i] + " Name: " + da.dvLeads[indexArray[i]][4].ToString() + " " + da.dvLeads[indexArray[i]][5].ToString() + "\n";
MessageBox.Show(temp);
}
This is the result:
Rows I wanted to change Rows that got changed
1. Employee 1 <-- 1. Employee 1
2. Employee 2 <-- 2. Employee 2 <--
3. Employee 3 <-- 3. Employee 3
4. Employee 4 <-- 4. Employee 4 <--
5. Employee 5 <-- 5. Employee 5 <--
6. Employee 6 6. Employee 6
7. Employee 7 7. Employee 7 <--
8. Employee 8 8. Employee 8
9. Employee 9 9. Employee 9
10. Employee 10 10. Employee 10
11. Employee 11 <--
Any help will be greatly appreciated
|
|
|
|
|
I can run a batch file that is in a folder on the local hard drive using "System.Diagnostics.Process proc = System.Diagnostics.Process.Start(psi);".
How do you run a batch file that in on the web server?
thanks
Charles Ihle
|
|
|
|
|
You pretty obviously can't run it from the client. You'd need an application running on the webserver that listens for clients and runs the batch file requested.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Hello everybody !!!
I have some question for you...... I have router connect to modem .... 2 computers connected to router..... on one of them i running Remote Server .... from the other one i running Client App that connect to Remote Server , i use connection string like
tcp://192.168.*.*:2301/ServerObj .....
the question is , if i want to connect from outside my network ( internet ) to server , what connection string i use ?? or if there some another solution for this problem ??
|
|
|
|
|
If your client is behind a firewall, then you can't the TcpChannel. You can try using the HttpChannel instead. If your proxy server allows HTTP traffic, then it should work fine.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
After changigng of all application configurations to Http,
you mean i can just enter on outside network client connection string like
http://wanaddress:2301/ServerObj and it should work ?
|
|
|
|