|
|
How come when I press Enter, and I am within richTextBox, my Form closes?
Is there a way insted of sending enter, send a new line?
Thank you
|
|
|
|
|
I have marshalled an imaging library and have recieved the pointer to the image buffer in an IntPtr object. How can I load that image in a System.Drawing.Image or Bitmap object. I would prefer not to use unsafe code unless deemed very necessary.
|
|
|
|
|
|
Hope someone can help me. I want to add two values in a combobox.
It's for players of a team. Now I have done it as follow with an DataSet:
<br />
cbPlayers.DataSource = dsPlayers.Tables["Players"];<br />
<br />
cbPlayers.ValueMember = "PlayerID";<br />
cbPlayers.DisplayMember = "FullName";<br />
This gives a combobox filled with only playernames
But I also would like to include the team name behind the playername in this combobox.
Who can help me out?
|
|
|
|
|
|
If You don't find suitable solution you can create custom
class that have properties that you want and load combobox
by code instead of data binding this way you can control what text will appear in each combobox item
MCAD
|
|
|
|
|
Hi Mohamad,
Is there a way to do it through DataView. I could not find a way to merge columns togather. RowFilter is the only thing you can do.
Live Life King Size
Alomgir Miah
|
|
|
|
|
Hi Alomgir
Sorry i don't understand what you mean can you explain it more?
What i want to say that he can create custom class
which contain properties like PlayerID,FullName
and add it in items collection or use datatable
MCAD
|
|
|
|
|
I understood your solution and I think it will work perfectly.
This is just out of curiosity,
I was just wondering if we can combine column values using DataView.
Live Life King Size
Alomgir Miah
|
|
|
|
|
You Can Create Expression Column That do that
And bind DisplayMenmber to it somthing like that
DataColumn dc=new DataColumn("Test",typeof(System.String)));
dc.Expression="ContactName + (' ')+ CustomerID ";
dataSet21.Customers.Columns.Add(dc);
comboBox1.DataSource=dataSet21.Customers;
comboBox1.DisplayMember=dataSet21.Customers.Columns["test"].Caption;
comboBox1.ValueMember=dataSet21.Customers.CustomerIDColumn.Caption;
MCAD
|
|
|
|
|
Thanx Mohamad. This is the solution for me! But one other thing
This works for me:
dc.Expression = "FullName + (' ')+ TeamName";
But I prefer an outcome like:
FullName [TeamName]
I tried the following but it gives an error:
dc.Expression = "FullName + (' [')+ TeamName" + (']');
How can I achieve this the right way?
|
|
|
|
|
How stupid?
I know it now:
dc.Expression = "FullName + (' [')+ TeamName + (']')";
Thanx anyway...
|
|
|
|
|
Thanks.........
Live Life King Size
Alomgir Miah
|
|
|
|
|
I've create an object:
class myClass{
int value;
string name;
}
now i've created an arraylist of it
ArrayList[] myArray = new ArrayList[4];
now i create multiarray of it:
for(int i=0; i<4; i++){
myArray = new ArrayList[7];
}
now i assign value in this way
...
myClass myClassRef = new myClass();
myClassRef.name = "James";
myArray[2][4] = myClassRef;
...
ok now i want to save all myArray inside a text file and then read back again a n new myNewArray.
How? Can you show me a bit of code?
|
|
|
|
|
I guess you will have to use an Array instead of ArrayList.
You will have to serialize the Array into an xml and stream it into a file.
let me give an eg.
private string CreateXML(Entities entities)
{
string xmlStr = String.Empty;
// Create an instance of the XmlSerializer class;
// specify the type of object to serialize.
XmlSerializer serializer = new XmlSerializer(typeof(Entities));
StringWriter writer = new StringWriter(CultureInfo.InvariantCulture);
try
{
writer = new StringWriter();
serializer.Serialize(writer, entities);
xmlStr = writer.ToString();
}
finally
{
if (writer != null)
{
writer.Close();
}
}
int index = xmlStr.IndexOf("?>");
xmlStr = xmlStr.Remove(0, index + 2);
index = xmlStr.IndexOf("UserName");
xmlStr = xmlStr.Remove(0, index);
xmlStr = "
|
|
|
|
|
Hi all,
How can I force a programm to work at the client side, in which the server pass an argument to that program.
Kind Regards,
Mohammad
|
|
|
|
|
You can't unless the account you application is running under also has Admin rights to the remote machine. Think about it. This is a HUGE security risk...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Dear Dave,
I am runining the application as an administrator, in which I need to send to the other client in the same network.Thanks
Kind Regards,
Mohammad
|
|
|
|
|
WMI will do this. See this[^], and this[^], and this[^]
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hello,
I have tow forms, both of them have richTextBox, on one form if you are typing the text in the textBox, and press Enter, cursor stays in the text box and goes to the next line (which is corect), on the other form however, if you press Enter, form closes. I checked the properties for both richTextBoxes and they seem the same. Any ideas to what's going on?
Thank you
|
|
|
|
|
Hello...
Have any buttons on your form ???
When yes, Look at the Properties from your form if the AcceptButton propertie is
set...
The AcceptButton propertie of the form specified a button which automatically fired when you are pressing enter...
|
|
|
|
|
My acceptButton property is set to (none}, on the form that if you press Enter within richTextBox, it closes.
|
|
|
|
|
Mhhh...
No idea... Try to completely rebuild the form or copy the existing and modify it...
Best regards...
|
|
|
|
|
Are you sure you set the MultiLine property to true in the second RichTextBox?
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|