|
Thanks for the quick answer i will try it and post feedback
Have a nice Day
|
|
|
|
|
Hai everybody,
I am having two radio options in my application.
When i am changing the options a message has to be prompted tot he user and then if the user clicks no then i should not check the next option instead i have to have the first option as selected.
For this i tried the code in the checked change event, but it is not checking the two options
Can any one tell me your suggestions.
Best Regards,
M. J. Jaya Chitra
|
|
|
|
|
What do you want ? For both radio buttons to be checked ? If you added them together, I'd expect them to form a group, this definately happens if they are on a panel. Then, when one is checked, the other will uncheck. If you want both options to be able to be selected, you should use checkboxes.
If that doesn't help, try posting some code and further explaining what is going wrong.
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 )
|
|
|
|
|
The options are in the panel.
If one is selected and when the option is changed to false i want to prompt the user and if the user confirms then the option has to be changed or else it should not change to false it has to be true only.
Best Regards,
M. J. Jaya Chitra
|
|
|
|
|
I think that you will not get any answer because your questions are not clear.
Pawel
|
|
|
|
|
M. J. Jaya Chitra wrote: If one is selected and when the option is changed to false i want to prompt the user and if the user confirms then the option has to be changed or else it should not change to false it has to be true only.
Perhaps you need a DialogResult from your MessageBox something like this:
if (MessageBox.Show("Do You Like Orange", "Choice!", MessageBoxButtons.YesNo) == DialogResult.No)
rdbApple.Checked = true;
________________________________
Success is not something to wait for, its something to work for.
|
|
|
|
|
Hi all,
Iam using regular expression to highlight a text. which is even highligting the text if the text is inside any textbox or text areas.
So here is my code pls help me how to get rid of the problem.
Regex re = new Regex("(<[^>]*?.*)("+keywords+"<\\/span>)(.*?>)", RegexOptions.IgnoreCase | RegexOptions.Singleline);
text = re.Replace(text, "$1$2$3") ;
-- key words have one word which has to be highlited --
so now iam trying to remove that span which has already put to those text inside a textbox. this is working fine only when there is only one occurance and not for multiple occurance of the same text.
Smitha
|
|
|
|
|
Smitha,
If you have not figured out your problem yet, please provide more information and I'll see what I can do to help.
Please give an example of the text inside the box, and what is being highlighted. They tell what you expect to happen.
Can you also provide a bit more code as to how you are highlighting the text.
Hogan
|
|
|
|
|
Hi Hogan,
Thanks for your reply,
Basically what am i trying to do is., iam returning few keywords from my backend and if my aspx page has those matching keywords i will highligt those words alone using some class. but the problem is its applying the class for the text inside the textbox also.
Please see the code below.
I have a user control., where i have this code
//this is a c# code
strCode = HighlightKeywords("Hemoglobin", strCode);
here i am calling a method which will return me strCode itself., the strCode will contain a innerhtml of a span and in that span
//This is how my span looks
Alpha-1-fetoprotein Hemoglobin
// now when the HighlightKeywords() method is called, using that method i should highlight that "Hemoglobin" word for the text inside span but not for the text inside my textbox.
so now the code for HighlightKeywords()
private static string HighlightKeywords(string keywords, string text)
{
// Swap out the ,<space> for pipes and add the braces
Regex r = new Regex(@", ?");
keywords = "(" + r.Replace(keywords, @"|") + ")";
// Get ready to replace the keywords
r = new Regex(keywords, RegexOptions.Singleline | RegexOptions.IgnoreCase);
// Do the replace
text = r.Replace(text, new MatchEvaluator(MatchEval));
/*the above code would have replaced the whole span's inner html text where ever Hemoglobin is there it would have replaced using that MatchEval eval method*/
-- now iam see whether there is any textbox if there is a text box then remove that span class='h1' text placed in that textbox.
Regex re = new Regex("(<[^>]*?)"+keywords+"<\\/span>(.*?>)", RegexOptions.IgnoreCase | RegexOptions.Singleline);
text = re.Replace(text, "$1$2$3") ;
return text ;
}
private static string MatchEval(Match match)
{
if (match.Groups[1].Success)
{
return "" + match.ToString() + "";
}
return ""; //no match
}
// its also replacing that "haemoglobin" inside that text box back to haemoglobin. but for only first occurance and not doing for the sencond and third occurance. am i missing anything., i have pasted the whole code. Pls let me know if iam doing something wrong.,
Smitha
|
|
|
|
|
I have been working on an app, and the final revision that the customer wanted was that they want the application to load, and hidden, except for the tray icon. So, I figured OK, easy enough, do a this.Hide(); or a this.Visible = false; upon load. So, it turns out that you cannot do that in the form_load or anywhere at all when the form is starting. I have no way to accomplish this. I found kind of hack-job way to do it. When the form loads, I can set ShowInTaskBar = false, and set the opacity to 0%. However, my project manager would like it done properly, so I am to take the time to find out how it is done. I haven't been able to find any working solutions though. Anyone ever done this, or have any ideas? Thanks!!!
I get all the news I need from the weather report - Paul Simon (from "The Only Living Boy in New York")
|
|
|
|
|
Set ShowInTaskBar to true and start the form minimized. It will work
|
|
|
|
|
I have been able to do that, and it works. But the customer and my project manager don't want to have the form minizized the user selects to view the form. There has to be a way to actually make the form load without being visible. That's is the only way my project manager will have it.
I get all the news I need from the weather report - Paul Simon (from "The Only Living Boy in New York")
|
|
|
|
|
You can make it invisible in the FormShown event and display the notify icon,set up an eventhandler for notify icon click where you show the form. If you want it minimized to tray when user select minimize then handler the resize event and hide the form if its state is minimized.
|
|
|
|
|
Thanks for your assistance, however,I don't see any FormShown event. I am using vs2005. Where are you seeing this event?
I get all the news I need from the weather report - Paul Simon (from "The Only Living Boy in New York")
|
|
|
|
|
event name is "Shown"
Pawel
|
|
|
|
|
Sorry, it's called Shown
|
|
|
|
|
Giorgi Dalakishvili wrote: Sorry, it's called Shown
It's all good. Thank you. How do I handle this event. Like, where should the event be placed in code, and how can I have this event not show the form?
I get all the news I need from the weather report - Paul Simon (from "The Only Living Boy in New York")
|
|
|
|
|
As far as you're using VS 2005 you can just double-click next to event name and place this piece of code there:
<br />
this.Hide();<br />
When the form is shown it will be hidden immediately so you might see the form disappearing.
|
|
|
|
|
Giorgi Dalakishvili wrote: As far as you're using VS 2005 you can just double-click next to event name and place this piece of code there:
this.Hide();
When the form is shown it will be hidden immediately so you might see the form disappearing.
That did the trick. Thank you for your help. Got my 5!
I get all the news I need from the weather report - Paul Simon (from "The Only Living Boy in New York")
|
|
|
|
|
Glad to help you
|
|
|
|
|
Why do you need to know your internet speed before you write a program?
|
|
|
|
|
Hi
In our application I m dealing with sockets+threads and I m getting this exception
"ActiveX control cant b instantiated bcz the current thread is not a single-threaded apartment."
Plz figure it out and reply me ASAP.
Regards
Shanzay
|
|
|
|
|
At the main entry point for your app, right above static void main() , put [STAThread] .
I get all the news I need from the weather report - Paul Simon (from "The Only Living Boy in New York")
|
|
|
|
|
" At the main entry point for your app, right above static void main(), put [STAThread]."
It is already there so now what should do to remove this error.
" ActiveX control 'd27cdb6e-ae6d-11cf-96bd-444553540000' cant b instantiated bcz the current thread is not in a single-threaded apartment."
thanx.
"
Shanzay
|
|
|
|
|
How do i delete this lines after i pass the info to my listview??
using (StreamReader sr = new StreamReader(path1 + "/personalpr.txt"))
{
while (sr.Peek() > 0)
{
line = sr.ReadLine();
if (line == "#")
{
name = sr.ReadLine();
nameAndJob = string.Concat(name);
Job = string.Concat(name);
if (list.ContainsKey(nameAndJob))
{
item1 = list[nameAndJob];
item1 = list[Job];
item1.SubItems[1].Text = sr.ReadLine();
item1.SubItems[3].Text = sr.ReadLine();
item1.SubItems[5].Text = sr.ReadLine();
/////////// Can i delete this lines in .txt file
}
}
}
my .txt file look like this:
#
1
2
3
4
#
5
6
7
8
|
|
|
|