|
I am trying to display a simple TaskDialog with marquee progress bar but i am getting this error:
Error 1 'whatwhen.frmMain.TaskDialogCallback(Microsoft.Samples.ActiveTaskDialog, Microsoft.Samples.TaskDialogNotificationArgs, object)': not all code paths return a value C:\Users\Jassim\Documents\Visual Studio 2008\Projects\whatwhen\whatwhen\main_form.cs 609 22 whatwhen
HERE IS MY CODE:
string update_string = null;
update_string = "some text here";
updateDialog.RightToLeftLayout = true;
updateDialog.WindowTitle = "title here";
updateDialog.MainInstruction = update_string;
updateDialog.CustomMainIcon = Properties.Resources.whatwhen;
List<TaskDialogButton> updateButtons = new List<TaskDialogButton>();
TaskDialogButton btnCancel = new TaskDialogButton();
btnCancel.ButtonId = 100;
btnCancel.ButtonText = "cancel";
updateButtons.Add(btnCancel);
updateDialog.Buttons = updateButtons.ToArray();
updateDialog.ShowMarqueeProgressBar = true;
updateDialog.Footer = "please wait...";
updateDialog.FooterIcon = TaskDialogIcon.Information;
updateDialog.Callback = new TaskDialogCallback(this.TaskDialogCallback);
int update_result = updateDialog.Show();
private bool TaskDialogCallback(ActiveTaskDialog updateDialog, TaskDialogNotificationArgs args, object callbackData)
{
if (args.Notification == TaskDialogNotification.Created)
{
updateDialog.SetProgressBarMarquee(true, 0);
return false;
}
}
|
|
|
|
|
Read the error:
Error 1 'whatwhen.frmMain.TaskDialogCallback(Microsoft.Samples.ActiveTaskDialog, Microsoft.Samples.TaskDialogNotificationArgs, object)': not all code paths return a value
Since your method expects a bool to be returned, at the moment, this only happens if the notification is created. So you need to either add an else or a simple return .
eg:
private bool TaskDialogCallback(ActiveTaskDialog updateDialog, TaskDialogNotificationArgs args, object callbackData)
{
if (args.Notification == TaskDialogNotification.Created)
{
updateDialog.SetProgressBarMarquee(true, 0);
return false;
}
return true;
}
Regards,
Gareth.
(FKA gareth111)
|
|
|
|
|
Hi, I can't get the original HTML source in
((HTMLDocument)webBrowser1.Document).documentElement.innerHTML
as the HTML code in viewsource. The code comes without quotes and all of the tag names comes as upper case. Is there any way to get original source in axWebBrowser as in System.Windows.Froms.WebBrowser.DocumentText ?
baris
|
|
|
|
|
I think you need to post this in the ASP.NET forum.
Regards,
Gareth.
(FKA gareth111)
|
|
|
|
|
The problem is not about ASP.NET, it is encountered in any type of websites (php, asp, aspx etc.) But, I will post it to ASP.NET part too.
baris
|
|
|
|
|
I have 2 user controls but I want to randomly add them to a form in a scrollable tile manner.
Each control is referenced by a name, so I can erase a specific control. How do I achieve this can someone give me heads up on how to achieve this..
I cant find anything to get me going.
thanks
ideasman
|
|
|
|
|
Keep a Dictionary<string,control> to hold references to them?
What's giving you trouble?
|
|
|
|
|
can you expand with some more example on your answer as I am having trouble grasping the concept.
I have done nothing like this before.
|
|
|
|
|
I would need more detail from you. Do you know how to add controls dynamically?
|
|
|
|
|
I have 2 user control which consists of a panel and a textbox and a button is on the panel.
In the form I call the panel(usercontrol) with a button. But I can only make it appear once. I want it to tile across the page. I want to randomly place each user control by a name reference so as I can erase a specific panel.
like so
private void button2_Click(object sender, EventArgs e)
UserControl1 bb = new UserControl1();
this.Controls.Add(bb);
cheers ideasman
|
|
|
|
|
1)You most place your controls inside a panel and enable scroll.
2)why destry the control? can´t you built many usercontrols and enable the one you need?
|
|
|
|
|
I have used a flowcontrol container in the past to deal with the positioning of the UCs. Placing them manually was a PITA, after designing the UC to match the size of the flowcontrol 1 column width it worked well. I basically wanted a scrollable list of the UCs, one for each application the user has access to.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Are you saying to keep placing this flowcontrol dynamically or do you place it many times on the form
and call the control to it???
|
|
|
|
|
Research the flowcontrol, you will find you place 1 FC and add your UCs to it, the FC manages your positioning (according to your settings) and scrolling.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
thanks Ill take your advice and give it a go
cheers
ideasman
|
|
|
|
|
I am relatively new to C#.
Very generally, how would you implement an authentication system?
You would have a user input form where the user puts username and password.
I suppose a database table would store a permission set?
Suppose you wanted to take the permission and disable some controls on forms.
|
|
|
|
|
|
Is it a web or windows application?
You can´t manage new logins without a database.
Make SQL store procedures for to add,delete logins, to login and to logout.
For security, let only your users execute your written store procedures, (don´t let then type sql for exemple).
|
|
|
|
|
Dear All,
I would like to import excel file to my datatable and i want to connect to excel 2007 using this string.
Provider=Microsoft.ACE.OLEDB.12.0;Data Source=my.xlsx;Extended Properties="Excel 12.0 Xml;HDR=YES";
but i am getting this exception
"could not find installable ISAM"
you are really appreciated to assist me in solving this problem.
Abdul Rahaman Hamidy
Senior Student Student in Computer Science
Kabul, Afghanistan
Software Developer
|
|
|
|
|
Abdul Rahman Hamidy wrote: Provider=Microsoft.ACE.OLEDB.12.0;Data Source=my.xlsx;Extended Properties="Excel 12.0 Xml;HDR=YES";
I can't help you with this approach, but i've always used this when I use Excel.
Cheers,
|
|
|
|
|
Hello C# programmers,
I currently dabble in programming with regular expressions. My problem is that I don't know, how I can extract a match if the programm finds one in a string. I already googled, but I couldn't found a site that could explain me how to manage it. I already tried Match and MatchCollection but it did not work. My previous source is following:
string test = "gjhsdjfjhfsdfjhsdf\ntztrzrtz\n\"http://screenshots.filesnetwork.com/68/potd/t_1215615627_85.jpg\"\nggdgfdg56ggdg";
string pattern = @"|.+\""http\://screenshots\.filesnetwork\.com/68/potd/t_[0-9]+_[0-9]+\.jpg\"".+|""";
Regex re = new Regex(pattern,RegexOptions.Multiline);
I am helpless with the rest, even though I know that it won't be that difficult.
I'm looking forward to your answers.
Best regards
MyPiano
modified on Sunday, August 3, 2008 8:52 AM
|
|
|
|
|
Your pattern is broken and you're confusing Multiline and Singleline.
I suggest you play with Expresso[^] ( it's free )
----------------------------------
Be excellent to each other
|
|
|
|
|
Thanks for the answer. The tool is great, but it does not tell me, how I can extract the Matches.
The new pattern:
string pattern = ".+(\"http\\://screenshots\\.filesnetwork\\.com/68/potd/t_[0-9]+_[0-9]+\\.jpg\").+";
By the way, the real string I am searching in looks so:
...
src="http://screenshots.filesnetwork.com/68/potd/t_1215615627_85.jpg" alt="Knights of the Old Republic 2" width="160" height="120"
...
EDIT:
I made a little progress:
Match m = re.Match(webSource);
richTextBox1.Text = m.Value;
I get an extract from the whole html document now, but it is still to big. All I want to extract is this part, which my pattern shell find:
http:
EDIT II: I think I got it now. The mistake was the .+ at the start and at the end.
If someone finds more mistakes or has tipps for me, I would be glad to read them.
Best regards
Joris
|
|
|
|
|
The Value property of the Match object contains the entire string that was matched. The Groups collection contains the values from the groups that you specified in the pattern, in this case the group matching the url.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Okay, thank you very much.
|
|
|
|