Reputation: 428 Architect
- Active Posts:
- 1,047 (0.71 per day)
- 09-June 09
- Profile Views:
- Last Active:
- May 15 2013 04:35 AM
- OS Preference:
- Favorite Browser:
- Favorite Processor:
- Favorite Gaming Platform:
- Your Car:
- Who Cares
- Dream Kudos:
02 May 2013 - 14:36
01 May 2013 - 22:25
18 Feb 2013 - 16:30
15 Jan 2013 - 01:53
30 Dec 2012 - 05:01
19 Dec 2012 - 02:28
10 Dec 2012 - 06:38
03 Dec 2012 - 10:15
23 Nov 2012 - 08:32
19 Nov 2012 - 15:07
Posts I've Made
Posted 15 Jan 2013So you are doing that kind of UIs with WinForms? Sounds like a pain in the butt.
How about you switch to WPF instead of C++. Learning curve is smaller and that will guarantee that your controls will be fast because all you are doing above can be done pretty simply with XAML.
For example, here is the Record button (I assumed it was a button) in your code quickly written in XAML:
<Button BorderThickness="0"> <StackPanel Orientation="Horizontal" Height="40"> <Border Background="Purple" Width="20" /> <TextBlock Text="1" FontSize="50" Margin="0,-15,0,0" Foreground="Red" /> <Border CornerRadius="0,20,20,0" Width="100" Background="Blue" > <TextBlock Text="RECORD" HorizontalAlignment="Center" VerticalAlignment="Center" /> </Border> </StackPanel> </Button>
No need to write any actual VB code for styling the UI. You can also search for sample UIs done with WPF by using google's image search (search for "WPF ui design" for example)
So I would suggest to create a small sample application with WPF so you know if it's fast enough (should be) and fills your needs. If it doesn't, I doubt that just C++ will either. Writing applications in C++ won't make them fast automatically. Sure, it might give you 10% boost in performance but slow code is still slow.
Btw. Have you tried to figure out why your code runs so slow? Try to set up some StopWatches inside your startup code to see which sections are bottlenecks.
Posted 27 Nov 2012I don't really understand what your problem is. Dependency properties are meant to enable data binding between your UI and business logic, DPs being on the UI side (like .Text property of a TextBox). You are not supposed to use Dependency properties inside your models (or viewmodels if you are using MVVM), for that purpose there is the INotifyPropertyChanged interface.
If you are creating a user control, then it's a good idea to have the properties on it declared as Dependency properties, if you require that you are able to bind to those properties.
So if you have a library which holds your business logic, you don't need Dependency properties inside that library. If you think you need them, then you are doing something wrong or understanding something wrong. Just the fact that Dependency property requires you to inherit from DependencyObject which is inside the System.Windows namespace should tell that they are not meant to be used in business logic.
If you need more help with this subject, I'd be happy to help. Just tell us in more detail what you are trying to accomplish and I'll do my best to help you.
Posted 23 Nov 2012You should read what GoTo does on MSDN, it's something completely different than you think it is.
To set focus on password textbox, try this code:
Please note that KeyPress event is fired each time user presses any key on txtUser. So if I try to type "janne_panne" on it, just "j" would appear and then focus moves to txtPass making it very annoying to write the whole user name.
Posted 23 Nov 2012Maybe you are just having a nightmare?
Posted 19 Nov 2012If you want to just create a string builder which contains the data you need, instead of creating a new instance of a string builder in Aggregate() function, create it outside a function and pass it as a parameter:
StringBuilder sbx = new StringBuilder(); string str = textSegs.Aggregate(sbx, (sb, i) => sb.Append(i), sp => sp.ToString());
But other than that the code seems to be working just fine. Aggregate function returns a string "Check In: 3:00 pmHotel is situated in the heart of the capital city the hotel isclose to all of the city's major attractions. Centrally locatedon New Jersey Avenue close to nearby dining and shopping."
- Member Title:
- WinRT Dev
- 25 years old
- December 6, 1987
- Oulu Finland
- Full Name:
- Janne Rautiola
- Years Programming:
- Programming Languages:
- C#, VB.NET