|
Now that it works I have a new problem.
The MouseUp event for a PictureBox gets fired the moment I click on a PictureBox .
The problem is that I'd use it allow the user to select multiple tiles while the mouse button is held down and paste them onto the map tiles, again while the mouse button is held down.
If the MouseUp event gets fired without actually releasing the mouse button, this is not possible.
Is there any way around this?
|
|
|
|
|
Good day All
i have a Following Arraylist that carries the List of Arraylist Values of String type. I want to Disable a Cell that does not match with the Values in the Arraylist.
ArrayList arr = Disable_Grid();
foreach(arr in ultraGridCycles)
{
;
}
Thank you
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswa@its.co.za
www.ITS.co.za
|
|
|
|
|
You have not supplied sufficient information.
Vuyiswa Maseko wrote: I want to Disable a Cell
What cell?
Vuyiswa Maseko wrote: does not match with the Values in the Arraylist.
There are many values in the array list. Are there many values in each cell?
Do you want to hide cells where the value of the cell is not contained within the ArrayList?
Finally, are you using .NET 1.x? If not, then why are you using an ArrayList.
|
|
|
|
|
Colin Angus Macka wrote:
What cell?
A Grid is made up of Columns and Rows. Like in in Excel we have Cells in a Gridview.
Colin Angus Macka wrote:
There are many values in the array list. Are there many values in each cell?
Yes, The Grid will be Populated with Values like
1234<br />
And in the Arraylist you might Find that there is 4. Now i want to Disable the cell that is carrying the values "123"
Colin Angus Macka wrote:
Do you want to hide cells where the value of the cell is not contained within the ArrayList?
Yes
Am Using .NET 2.0
Thank you
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswa@its.co.za
www.ITS.co.za
|
|
|
|
|
How about using a HashSet instead?
(No one uses Arraylist anymore anyway.)
|
|
|
|
|
That Wouldn't be a problem. I have changed from Arraylist but not to HashSet , am using 2.0 not 3.5
Thanks
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswa@its.co.za
www.ITS.co.za
|
|
|
|
|
In my opinion HashSet is the only reason to use 3.5, if it weren't for that I'd still 2.0 as well.
Are you using a Dictionary then? That's what I use in my Set[^] class.
|
|
|
|
|
Hi!
i know people have asked a lot about comboboxes but it's not really about how to get the value or index or whatever.Let me explain.it's users access management application with users, roles and rights:
i have a form editRight with 2 combobox cmbUsers to list users and cmbroles to list role of each users and 3 listboxes.let's pause here
on load event i fill users combobox with users
private void EditRight_Load(object sender, EventArgs e)<br />
{<br />
try<br />
{<br />
dt_users = UserManager.FindAll().Tables[0];<br />
cmbUsers.DataSource = dt_users.DefaultView;<br />
cmbUsers.DisplayMember = "user_name";<br />
cmbUsers.ValueMember = "user_id";<br />
<br />
CallFillRoleCombo((int)cmbUsers.SelectedValue);<br />
}<br />
catch (System.Exception ex)<br />
{<br />
MessageBox.Show(ex.Message);<br />
}<br />
}<br />
<br />
private void CallFillRoleCombo(int uid)<br />
{<br />
try<br />
{<br />
dt_roles = UserRoleManager.FindByUser(uid).Tables[0];<br />
<br />
cmbroles.DataSource = dt_roles.DefaultView;<br />
cmbroles.DisplayMember = dt_roles.Columns[2].ToString();<br />
cmbroles.ValueMember = dt_roles.Columns[1].ToString();<br />
}<br />
catch (System.Exception ex)<br />
{<br />
MessageBox.Show(ex.Message);<br />
}<br />
<br />
}<br />
<br />
private void cmbUsers_SelectedValueChanged(object sender, EventArgs e)<br />
{<br />
CallFillRoleCombo((int)cmbUsers.SelectedValue);<br />
}<br />
when i run the code its throws exception:Object reference not set to an instance of an object.It seems that its calling the cmbUsers_SelectedValueChanged eventhandler when setting the display member of the cmbUsers combobox.
How to work around it?Thank you for reading this.
eager to learn
|
|
|
|
|
In the following code for loading data in user combobox
unsubscribe the event cmbUsers_SelectedValueChanged and after filling data
subscribe again
private void EditRight_Load(object sender, EventArgs e)
{
try
{
dt_users = UserManager.FindAll().Tables[0];
cmbUsers.DataSource = dt_users.DefaultView;
cmbUsers.DisplayMember = "user_name";
cmbUsers.ValueMember = "user_id";
CallFillRoleCombo((int)cmbUsers.SelectedValue);
}
}
hope this works for you!
|
|
|
|
|
got your problem
try this
private void cmbUsers_SelectedValueChanged(object sender, EventArgs e)
{
if (comboBox2.SelectedValue.GetType() == typeof(int))
CallFillRoleCombo((int)cmbUsers.SelectedValue);
}
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
Thanks guys for replying this post.Really apreciated it.The method that worked for me is the one suggested by deep@Pune.Thanks
eager to learn
|
|
|
|
|
your most welcome!!
yersterday I forgot to include actual lines in the code to subscribe and unsubscribe the event!!
soru for that!!!!!
|
|
|
|
|
Hi ,
I need some sample code that populates the checkBoxlist(C# Windows Application) based on the table values present is a SQL server database table.?
Someone help in this regard..
Thanks in Advance,
Balaguru
|
|
|
|
|
|
Hi evryone
How can i make pdf from cristal report - in C# code (dont whant to see hem) ?
thank's
|
|
|
|
|
|
Hi all. I'm sure there are loads of articles and examples on the net for what I'm trying to do but I don't know what you would call it and consequently I'm not sure what to Google for.
I'm trying to simplify a file path to something that will fit into a certain number of characters. I think I can best explain by using an example.
Let's say I have a file path as follows:
C:\Documents and Settings\My Name\My Documents\Work Documents\Business Plan.doc
but I have only limited space to display this path. I'm not overly concerned that the user should be able to read the full path (although I can do that by providing a ToolTip or putting the full path in the StatusStrip or whatever) but I would like for the user to get a general impression of where the path points.
I am in other words looking for a result along the lines of:
C:\Docum...\...\Business Plan.doc
If you have any suggestions for articles or examples on the net that deal with this I'd be happy to hear. Also, the above sample result is what I quickly came up with but there may be more sensible ways of stripping down long paths to something shorter. Please let me know if you have any advice.
|
|
|
|
|
|
Only took me 10 minutes to knock this together - close enough?
<br />
private static string TruncatePath(string path, int chars)<br />
{<br />
if (path.Length < chars)<br />
return path;<br />
string drive = path.Substring(0, path.IndexOf('\\') + 1);<br />
string fileName = path.Substring(path.LastIndexOf('\\'));<br />
if ((fileName.Length + drive.Length) > chars)<br />
return drive + "..." + fileName.Substring((fileName.Length + drive.Length) -(chars + 3));<br />
else<br />
{<br />
return drive + path.Substring(drive.Length, chars - (drive.Length + fileName.Length)) + "..." + fileName;<br />
} <br />
}<br />
It definitely isn't definatley
|
|
|
|
|
Excellent stuff! That's exactly what I had been looking for. It wasn't really necessary to actually go and write the code but I appreciate the effort and your 10 minutes certainly saved me more than just 10 minutes.
I was curious actually whether there wasn't some class in the .NET framework that could achieve this. It turns out there is, TextRenderer.MeasureText and TextFormatFlags.PathEllipsis but that is when you render the text graphically. Your function is simple and elegant and does exactly what I wanted to do.
|
|
|
|
|
Hi.
In a report (rdl) I have a contract text that is about 3 A4 pages.
When I put the text in report, it only fills the odd pages. i.e. for 3 pages it produces 6 pages which pages 2,4,6 are blank.
What should I do to fix this problem?
Best wishes
|
|
|
|
|
What do I need to develop Outlook 2007 add-in using VSTO. I'm using Visual Studio 2005 Professional Edition.
What software/patches/libraries etc are required?
|
|
|
|
|
simple[^]
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
|
Install .Net Framework 3.5 or higher
Ahmed Manzoor wrote: Lol, I didn't find any links on installation...
well well well, you have to read...no body gonna give you an exact thing always as well as you can change the searching text
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|