Automatic vertical scroll bar in WPF TextBlock?

Wrap it in a scroll viewer: <ScrollViewer> <TextBlock /> </ScrollViewer> NOTE this answer applies to a TextBlock (a read-only text element) as asked for in the original question. If you want to show scroll bars in a TextBox (an editable text element) then use the ScrollViewer attached properties: <TextBox ScrollViewer.HorizontalScrollBarVisibility=”Disabled” ScrollViewer.VerticalScrollBarVisibility=”Auto” /> Valid values for … Read more

Process.start: how to get the output?

When you create your Process object set StartInfo appropriately: var proc = new Process { StartInfo = new ProcessStartInfo { FileName = “program.exe”, Arguments = “command line arguments to your executable”, UseShellExecute = false, RedirectStandardOutput = true, CreateNoWindow = true } }; then start the process and read from it: proc.Start(); while (!proc.StandardOutput.EndOfStream) { string … Read more

Introducing FOREIGN KEY constraint may cause cycles or multiple cascade paths – why?

Because Stage is required, all one-to-many relationships where Stage is involved will have cascading delete enabled by default. It means, if you delete a Stage entity the delete will cascade directly to Side the delete will cascade directly to Card and because Card and Side have a required one-to-many relationship with cascading delete enabled by … Read more

What is the difference between CurrentCulture and CurrentUICulture properties of CultureInfo in .NET?

CurrentCulture is the .NET representation of the default user locale of the system. This controls default number and date formatting and the like. CurrentUICulture refers to the default user interface language, a setting introduced in Windows 2000. This is primarily regarding the UI localization/translation part of your app. Whatever regional options the system is configured … Read more

Visual Studio jump to next error shortcut?

F8 (and Shift+F8 to go backwards). Or at least that’s what it is in my keyboard profile – you can go to tools\options\environment\keyboard and check out Edit.GoToNextLocation. Note If you configured Visual Studio using VB keyboard settings, no key has been assigned to this function. You need to pick your own and assign them.

How to recursively list all the files in a directory in C#?

Note that in .NET 4.0 there are (supposedly) iterator-based (rather than array-based) file functions built in: foreach (string file in Directory.EnumerateFiles(path, “*.*”, SearchOption.AllDirectories)) { Console.WriteLine(file); } At the moment I’d use something like below; the inbuilt recursive method breaks too easily if you don’t have access to a single sub-dir…; the Queue<string> usage avoids too … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)