Tuesday, August 28, 2012
DataGridView'de Header Kısmına ComboBox Eklemek
Form_Load(........
Dim rect As Rectangle = DataGridView1.GetCellDisplayRectangle(3, -1, True)
'cbVolumeOrder, datagridview üzerinde göstermek istediğimiz combobox ımız
cbVolumeOrder.Location = New Point(rect.Location.X + 60, rect.Location.Y + 15)
DataGridView1.Controls.Add(cbVolumeOrder)
Textbox içine sadece alphanumeric karakterler girilmesini sağlayan kod.
Private Sub textBox_KeyPress(........
Dim cInvalidChars() As Char = {"~", "`", "!", "@", "#", "$", "%", "^", "&", "*", "(", ")", "_", "-", "=", "+", "{", "[", "}", "]", "|", "\", ":", ";", """", "'", "<", ",", ">", ".", "?", "/"}
Dim result As Boolean = False
result = cInvalidChars.Contains(e.KeyChar)
If result Then
e.Handled = True
End If
End Sub
DataGridView de bir hücreye odaklanmak.
DataGridView1.CurrentCell = DataGridView1.Item("ColumnName", rowIndex)
How to focus a cell in datagridview in vb.net
How to focus a cell in datagridview in vb.net
Monday, August 13, 2012
VB.Net'te Combobox içine Value ve Text içeriklerini eklemek
ComboBoxItem text ve value değerlerini alan class ımız. Kodunu aşağıda bulabilirsiniz.
'--------------------------------------------------------------
Dim lstMonths As New List(Of ComboBoxItem)
lstMonths.Add(New ComboBoxItem("January", 1))
lstMonths.Add(New ComboBoxItem("February", 2))
lstMonths.Add(New ComboBoxItem("March", 3))
lstMonths.Add(New ComboBoxItem("April", 4))
lstMonths.Add(New ComboBoxItem("May", 5))
lstMonths.Add(New ComboBoxItem("June", 6))
lstMonths.Add(New ComboBoxItem("July", 7))
lstMonths.Add(New ComboBoxItem("August", 8))
lstMonths.Add(New ComboBoxItem("September", 9))
lstMonths.Add(New ComboBoxItem("October", 10))
lstMonths.Add(New ComboBoxItem("November", 11))
lstMonths.Add(New ComboBoxItem("December", 12))
'cbMonths is a combobox
cbMonths.DataSource = lstMonths
cbMonths.DisplayMember = "Text"
cbMonths.ValueMember = "Value"
'--------------------------------------------------------------
'--------------------------------------------------------------
Dim lstMonths As New List(Of ComboBoxItem)
lstMonths.Add(New ComboBoxItem("January", 1))
lstMonths.Add(New ComboBoxItem("February", 2))
lstMonths.Add(New ComboBoxItem("March", 3))
lstMonths.Add(New ComboBoxItem("April", 4))
lstMonths.Add(New ComboBoxItem("May", 5))
lstMonths.Add(New ComboBoxItem("June", 6))
lstMonths.Add(New ComboBoxItem("July", 7))
lstMonths.Add(New ComboBoxItem("August", 8))
lstMonths.Add(New ComboBoxItem("September", 9))
lstMonths.Add(New ComboBoxItem("October", 10))
lstMonths.Add(New ComboBoxItem("November", 11))
lstMonths.Add(New ComboBoxItem("December", 12))
'cbMonths is a combobox
cbMonths.DataSource = lstMonths
cbMonths.DisplayMember = "Text"
cbMonths.ValueMember = "Value"
'--------------------------------------------------------------
Friday, August 10, 2012
10 Tips For Designing A Usable Interface
Designing a usable interface is about the skills of the designer as well as how they are able to teach the user how to interact with the site. Here are ten tips we have used to design user interfaces:
- Know your target audience – This is the first question to ask and answer before any designs are even contemplated. Knowing who you’re designing for enables you to make the final product useful.
- Make sure your design flows – Like a staircase, every step leads the user to where s/he wants to go. Having the right flows keeps the user from wondering where they are and how they got there.
- Easy navigation – Knowing where they are and where to go next to complete the task is one of the basic elements of UX.
- Recovery from errors – Minimize the negative effect by creating a flow that allows users to quickly recover from errors and find ways around it.
- Put first things first – This is not only the first rule for highly effective people but it’s also a great guide for highly effective user interface design. Putting all elements into a hierarchy allows the user to quickly find whats/he is looking for, which in turn makes UI intuitive for them.
- Think usability, not just simplicity – In a previous post, we questioned whethersimplicity is critical for usable design. Simplicity for simplicity sake is useless. Usable design creates a positive user experience by using simplicity to minimize the learning curve and getting rid of all obstacles between the use and the goal.
- Keep text simple – For whatever content is on the site, make sure that it’s easy to understand and won’t have the user consulting the dictionary. Keep content clear, concise, and understandable.
- Less UI = better UX– Extraneous elements cause the user to lose focus. Good design is clear, concise and invisible because it is felt more than it’s seen.
- Put everything in its place – The key here is relevance. Unless there is a good reason not to, UI should follow existing user mental models. Having elements in the expected place creates consistency and builds trust with the user.
- Use colors wisely – Colors should be used to emphasize functionality of elements. It would help overall UI intuitiveness and help users quickly find desired functionality.
Wednesday, August 1, 2012
VB.NET : OpenFileDialog ile dosya adı ve dizin yoluna ulaşmak.
OpenFileDialog ile seçilen dosyanın adına ve dizin yoluna ulaşmak için aşağıdaki kod kullanılmaktadır.
Dosya Adı için : System.IO.Path.GetFileName(openFileDialog.FileName)
Dizin Yolu için : System.IO.Path.GetDirectoryName(openFileDialog.FileName)
How to get File Name and File Path from OpenFileDialog.
Dosya Adı için : System.IO.Path.GetFileName(openFileDialog.FileName)
Dizin Yolu için : System.IO.Path.GetDirectoryName(openFileDialog.FileName)
How to get File Name and File Path from OpenFileDialog.
Subscribe to:
Posts (Atom)