|
Standard question #1:
What do you mean by "not working"?
Mridang Agarwal wrote: i can't possibly write a set of if else statements that take into account all the possible combinations of checkboxes being selected and appropriately calling the function.
Yes, you can. It's only 128 combinations. I can very well understand if you don't want to do it, but it's clearly possible to do.
---
b { font-weight: normal; }
|
|
|
|
|
Why not just use a loop?
ArrayList checkBoxes = new ArrayList();
chkSunday.Tag = DaysOfTheWeek.Sunday;
checkBoxes.Add (chkSunday);
...
chkSunday.Tag = DaysOfTheWeek.Saturday;
checkBoxes.Add (chkSaturday);
DaysOfTheWeek selectedDays = DaysOfTheWeek.None;
for (int nDay=0; (nDay < checkBoxes.Count); nDay++) {
CheckBox cb = checkBoxes[nDay] as CheckBox;
if (cb.Checked) {
if (selectedDays == DaysOfTheWeek.None)
selectedDays = (DaysOfTheWeek) cb.Tag;
else
selectedDays |= (DaysOfTheWeek) cb.Tag;
}
} /ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|
|
There isn't a DaysOfTheWeek.None . What do I do now?
|
|
|
|
|
Make up your own enum (eg: MyDayOfTheWeek ) or use a set of days of the week, where the empty set implies "no day selected".
/ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|
|
bool checkMonday = true;
bool checkTuesday = true;
bool checkWednesday = true;
bool checkThursday = false;
bool checkFriday = false;
bool checkSaturday = false;
bool checkSunday = true;
DaysOfTheWeek day=(DaysOfTheWeek)0x00;
day |= (DaysOfTheWeek)((checkMonday ? 0x01 : 0x00) << Convert.ToInt32(DaysOfTheWeek.Monday));
day |= (DaysOfTheWeek)((checkTuesday ? 0x01 : 0x00) << Convert.ToInt32(DaysOfTheWeek.Tuesday));
day |= (DaysOfTheWeek)((checkWednesday ? 0x01 : 0x00) << Convert.ToInt32(DaysOfTheWeek.Wednesday));
day |= (DaysOfTheWeek)((checkThursday ? 0x01 : 0x00) << Convert.ToInt32(DaysOfTheWeek.Thursday));
day |= (DaysOfTheWeek)((checkFriday ? 0x01 : 0x00) << Convert.ToInt32(DaysOfTheWeek.Friday));
day |= (DaysOfTheWeek)((checkSaturday ? 0x01 : 0x00) << Convert.ToInt32(DaysOfTheWeek.Saturday));
day |= (DaysOfTheWeek)((checkSunday ? 0x01 : 0x00) << Convert.ToInt32(DaysOfTheWeek.Sunday));
TestFunction(day);
-- modified at 22:12 Wednesday 29th March, 2006
|
|
|
|
|
hi!
I'm doing a project in image processing. I have implemented sobel edge detection.But the edge is not thin.
I tried to implement canny edge detection. But I don't understand how to do non maximum suppression.If anyone has canny edge detection implemented please please share it.
any edge tracking algorithm for thinning the edges will be helpful.
signing off is preci
|
|
|
|
|
|
Thankyou Ravi.
I have already been to the links the you have specified.I have also implemented canny edge detection in vb.net but the results are not good, meaning the edges are not thin (preferably a single line of pixels).
Is there some way to do that? Non maximum suppression is not very helpful. If you know how to track the edges please help.It's urgent.
signing off is preci
|
|
|
|
|
Sorry, my knowledge of image processing resembles the null set.
That being said, have you seen the Rothwell[^] method? Any better than Sobel and canny?
/ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|
|
Hi again!
I have worked around the problem.I added some new conditions and some new ideas and the results were good.But I still work to do.I greatly appreciate your help. Thank you
again!!
signing off is preci
|
|
|
|
|
I want to get computer name, but i dont know how to do.
help me!
Thanks a lot
superdragon
|
|
|
|
|
I have found it, i used SystemInformation.ComputerName to get computername
superdragon
|
|
|
|
|
i have chekedlistbox, it has some items in it,when it runs, after checking some items, i want to indecate which items is checked, but i dont know what properties to indicate that.
please help me to solve it.
Thanks for helpings.
superdragon
|
|
|
|
|
i have found it. Thanks everyone!
superdragon
|
|
|
|
|
I'm not even sure how to ask this but i've got a problem that has me stumped and i'm hoping someone can shed some light on it.
I've got a winform application written in c# 2.0 that has most of it's content and controls wired to a remote sql server 2000 database. now there is one specific control tha is acting weird on another computer it's a standard NumericUpDown Control when the form it belongs to is shown it's min and max value as well as it's current value are set based on criteria from the main form. now i've run the program on windows xp, xp 64 and server 2003 enterprise on my computer and it works fine in all of them. but when i took it to the computer it was supposed to be run on after the install ran it installed the .net framework and registered everything with caspol. Now once the program is run and everything else works fine but when the form with the numericupdown control is loaded the numericupdown control has some arbitrary negative number passed to it like -17 or -16 and i have no clue why it would do that on one xp pro machine and not on another.
Anyway i hope someone can at least point me in the right direction
Thanks
Ryan
|
|
|
|
|
Hi, I have a problem as follow:
I'm developing a application on PocketPC using C#, I have a file .wav on PC, but I don't know how to add this file to my application ( so that this file is deployed to PocketPC with my application).
Can you help me?
Thanks,
Hung.
Hung
|
|
|
|
|
Dear all,
I am trying to get the target location data a shortcut file on a desktop. I managed to get to the desktop using Environment.GetEnvironmentVariables() and can retrieve the shortcut file but can not find the way to retrieve the target location. Could anyone please help? Thank you!
|
|
|
|
|
If you use Shell interface function CreateShortcut with name of existing link as argument - created WshShortcut object will be filled with shortcut information.
sample:
IWshShell ws = new IWshRuntimeLibrary.WshShell();
string shortcutFile = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Desktop) + "\\" + "ToDo.txt.lnk";
IWshShortcut sc = (IWshShortcut)ws.CreateShortcut(shortcutFile);
after that sc.TargetPath will contain link target. Of course, if you have ToDo.txt shortcut on your desktop .
Don't forget to add reference to %system32%\\wshom.ocx and add "using IWshRuntimeLibrary;"
Hope that helps.
____________________________________________
Robin Panther http://www.robinland.com
|
|
|
|
|
Thank you very much for your reply.
The shortcut files already exist on the desktop so I just need to read? the file property
to get the target location. I have looked at IWshShortcut before and only found how to create a shortcut file.
Unless ws.CreateShortcut(shortcut) works for existing shortcut files too?
Thank you !
-- modified at 3:25 Thursday 30th March, 2006
|
|
|
|
|
I think my mistake
(IWshShortcut)ws.CreateShortcut(shortcut) doesn't create a shortcut file on the desktop.... silly me.
Thank you for your help!!!
-- modified at 3:35 Thursday 30th March, 2006
|
|
|
|
|
I have a Service which is installed already. If I need to change the startuptype of the service how Can I do that using C#?
I know that before Installing the service we can set the starttype property to set the StartType as automatic or manual. But after installing the service if want to change how should I do it?
Thanks
King
|
|
|
|
|
Hi,
i have a combobox (dropdown style not dropdownlist) and a i have
to open a form when i click on the text, but not when i click on the
arrow or when i select a item.
how can i do? some one have any idea?
thanks, cliffer
|
|
|
|
|
on comboBox1_SelectedIndexChanged event call form
example:
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)<br />
{<br />
Form f = new Form();<br />
f.Height = 150;<br />
f.Width = 150;<br />
f.Show();<br />
}
_____________________
Proud to be Albanian
_____________________
|
|
|
|
|
Hi,
I am currently working on a application that generates faxes from mail merged documents (Word and Excel datasource). Everything works fine. Except the client has an habit of creating the mail merge document with all the information in word 2003 Textbox. (Including the mail merge field). I use C# to do the mail merge and so far i have not found any way of reading these fields. (The text boxes are termed as Shapes in the Word API, so far I havent been able to find how to access anything inside a Shape).We have already decided to tell the client to take the Mail merge fields out of text boxes so that the Word API can read them.
But i want to be absolutely sure that there is no way to read them before i request the client to make an process change. If anyone has encounted this issue before please advise.
Thanks Kalyan
Word.ApplicationClass wrdApp;
Word.Document wrdDoc;
wrdApp = new Word.ApplicationClass();
object docuFile = this.lblDocSrc.Text;
wrdDoc = wrdApp.Documents.Open(ref docuFile, ref oMissing,ref oMissing,ref oMissing,
ref oMissing,ref oMissing,ref oMissing,ref oMissing,ref oMissing,ref oMissing,
ref oMissing,ref oMissing,ref oMissing,ref oMissing,ref oMissing,ref oMissing);
foreach(Word.Field myField in wrdDoc.Fields)
{
myField.Select();
if (!DocFields.Contains(myField.Result.Text.ToString()))
{
DocFields.Add(myField.Result.Text.ToString());
}
i++;
}
|
|
|
|
|
Hello,
If I use the tab to go through the datagridview it is added automatically a new item.
Here I use the ListChanged Event and ItemAdded to Update another internal list. To hold the list up to date I have to remove also the items when a row is removed.
When I have made no changes to the Item and I press in the last cell another time the tab key the last row is removed, and after that another time added. But now I have the problem that I can't find any event which happens before the row is removed to hold my list uptodate...
Has anyone an idea?
Regards
Hansjörg
|
|
|
|