|
The best solution for this would be to research using Google. However two URL's you may wish to review are....
http://www.dotnetperls.com/datagridview-vbnet
http://vb.net-informations.com/datagridview/vb.net_datagridview_tutorial.htm
|
|
|
|
|
Thanks,
I found a really helpful tutorial here :
http://www.codeproject.com/Articles/26289/Editable-and-Multi-Functional-Datagridview
|
|
|
|
|
I have a combobox attached to a database with names in it. How do I get the combolist to show only the name of the text typed as it is type. IE: If I type "A" I want the list to display only the names that start with the letter "A". I was able to do this in the VB6 but lost the function when I upgraded to Visual
Studio 2010.
Please help!!!!
cjscs
|
|
|
|
|
Not to hard to add the functionality.
Have a start here[^].
|
|
|
|
|
The AutoComplete functionality Jorgen links you to is nice. But you might be asking for a simple way to filter your list items (which could be used in conjunction with AutoComplete). Have a look at the BindingSource class and its Filter property. Something like this:
Dim bs As New BindingSource
bs.DataSource = dtTable
Me.ComboBox1.DataSource = bs
Me.ComboBox1.DisplayMember = "DISPLAY_COLUMN"
Private Sub ComboBox1_KeyPress(sender As Object, e As System.Windows.Forms.KeyPressEventArgs) Handles ComboBox1.KeyPress
bs.Filter = "DISPLAY_COLUMN LIKE '" & e.KeyChar & "%'"
End Sub
|
|
|
|
|
description:
Custom screensaver in vb.net 2008 of a slideshow using local resource images embedded. I got the exe working fine.
general steps done so far:
1) form properties to no border and full screen
2) import images to local resources so they are embedded in the application
3) create a timer to change the form.background to the next image
4) generate a random number reflecting the number of images and confirm no repeats
5) close application trigger (spacebar)
6) test on my systems and work fine as exe
Problem:
#1
Within install shield reg settings pushed
-1 HKCU/controlpanel/dekstop/ScreenSaveActive = 1
-2 ScreenSaveTimeOut = 900 (15 minutes)
-3 SCRNSAVE.EXE = C:\Windows\MICHAE~1.SCR
1 and 3 work
2 doesn't set the screensaver timer to 15 minutes, it stays at the same timer previously entered
#2
right clicking on the desktop of Win 7 and selecting Personalize. The screensaver is there, but clicking on Screen Saver to open up the screensaver properties, the screensaver initiates. Stopping the screensaver brings the screensaver properties up fine. Using another way like Control Panel > Appearance and Personalization > Change screen saver works as expected. Using the start>run "screensaver" to open screensaver properties starts the screensaver and after closing the screensaver, the screensaver properties is available.
#3
in the screensaver properties, selecting either settings or preview start the screensaver twice. In other words, the screensaver will start, then after you close it, it starts again a second time.
#4
although the screensaver shows it is in the screensaver properties window. even after waiting the designated time to pass, the screensaver doesn't initiate.
Can someone lend a hand on how to resolve these issues?
www.MichaelHulak.com
modified 7-May-12 1:36am.
|
|
|
|
|
Have you followed the steps outlined here[^]?
Binding 100,000 items to a list box can be just silly regardless of what pattern you are following. Jeremy Likness
|
|
|
|
|
i tried, but not successful. Maybe if i show the code i currently have to assist
Imports System.Timers
Imports System.Drawing
Public Class Form1
Dim A As Int16 = 0
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
PrevInstance()
' If PrevInstance() = True Then
' MessageBox.Show("sdfsdf")
' Close()
' End
' Else
' MessageBox.Show("222222")
' End If
running()
Dim startPoint1 As New Point(Me.Width / 2 - 165, 19)
lbl_top.Location = startPoint1
Dim startPoint2 As New Point(Me.Width / 2 - 62, 93)
lbl_bottom.Location = startPoint2
A = RandomNumber(0)
Images()
Timer1.Enabled = True
Timer2.Enabled = True
End Sub
Function PrevInstance() As Boolean
If UBound(Diagnostics.Process.GetProcessesByName(Diagnostics.Process.GetCurrentProcess.ProcessName)) > 0 Then
MessageBox.Show("222222")
Me.Close()
Return True
Else
Return False
End If
End Function
Private Sub Form_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, _
ByVal X As Single, ByVal Y As Single)
Static count As Integer
If count > 2 Then
Me.Close()
End
Else
count = count + 1
End If
End Sub
Public Sub running()
'The end result of this code is similar to Visual Basic 6.0's App.Previnstance feature.
Dim appName As String = Process.GetCurrentProcess.ProcessName
Dim sameProcessTotal As Integer = Process.GetProcessesByName(appName).Length
If sameProcessTotal > 1 Then
MessageBox.Show("A previous instance of this application is already open!", " App.PreInstance Detected!", MessageBoxButtons.OK, MessageBoxIcon.Information)
Me.Close()
End If
appName = Nothing
sameProcessTotal = Nothing
End Sub
Private Sub CreatePointsAndSizes(ByVal e As PaintEventArgs)
' Create the starting point.
Dim startPoint As New Point(Me.Width / 2 - 331)
' Use the addition operator to get the end point.
Dim endPoint As Point = Point.op_Addition(startPoint, _
New Size(140, 150))
' Draw a line between the points.
e.Graphics.DrawLine(SystemPens.Highlight, startPoint, endPoint)
' Convert the starting point to a size and compare it to the
' subtractButton size.
Dim buttonSize As Size = Point.op_Explicit(startPoint)
End Sub
Protected Overrides Function ProcessCmdKey(ByRef msg As Message, _
ByVal keyData As Keys) As Boolean
' spacebar to escape screensaver
Const WM_KEYDOWN As Integer = &H100
Const WM_SYSKEYDOWN As Integer = &H104
If ((msg.Msg = WM_KEYDOWN) Or (msg.Msg = WM_SYSKEYDOWN)) Then
Select Case (keyData)
Case Keys.Space
Close()
End Select
End If
Return MyBase.ProcessCmdKey(msg, keyData)
End Function
Private Sub Timer1_Tick(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Timer1.Tick
Images()
End Sub
Private Sub Timer2_Tick(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Timer2.Tick
lbl_bottom.Visible = False
lbl_top.Visible = False
Timer2.Enabled = False
End Sub
Public Sub Images()
If A = 1 Then
Me.BackgroundImage = Screensaver_01.My.Resources.Resources._2011_06_07_IMG_2969_WM
A = RandomNumber(1)
Exit Sub
End If
If A = 2 Then
Me.BackgroundImage = Screensaver_01.My.Resources.Resources._2011_06_28_IMG_4278_WM
A = RandomNumber(2)
Exit Sub
End If
If A = 3 Then
Me.BackgroundImage = Screensaver_01.My.Resources.Resources._2011_08_03_IMG_9462_WM
A = RandomNumber(3)
Exit Sub
End If
If A = 4 Then
Me.BackgroundImage = Screensaver_01.My.Resources.Resources._2011_08_21_Confidence_WM
A = RandomNumber(4)
Exit Sub
End If
End Sub
Public Function RandomNumber(ByVal previous_number As Integer, _
Optional ByVal MinNumber As Integer = 1) As Integer
Dim randomObject As Random = New Random()
Dim rndNum As Integer = previous_number
Dim output As String = ""
While previous_number = rndNum
rndNum = randomObject.Next(1, 4)
End While
Return rndNum
End Function
End Class
|
|
|
|
|
how to play videos from my database on my vb.net form.? plz if any one know rly me nw....
|
|
|
|
|
By loading the data, prolly a bitarray, and playing it back.
If you want more specific help, you'll have to give us some more specifics on your app, what you're doing, and where you're stuck. No, there's little chance that someone is going to walk you through the entire process.
- What type of database? Sql Server I presume?
- What exactly do you need help with? Loading the bits, playing the bits, or just programming in general?
- What have you tried? Did you try the articles here on CodeProject?
Bastard Programmer from Hell
|
|
|
|
|
|
I don't think the admins and moderators would like that too much, that is spam.
Simple Thanks and Regards,
Brandon T. H.
Been programming in Visual Basic for 4 years this point forward, and is very good at it (I can even create programs completely on code, without dragging those items from the toolbox). Programming C++ for 1 year so far and the same with C#.
Many of life's failures are people who did not realize how close they were to success when they gave up. - Thomas Edison
|
|
|
|
|
Hello !
in vb.net 2010 , i have a tabcontrol with 3 tabs , on each of them i have some bound textboxes. The textboxes are bound when the form is open.
The problem is that if i try to use a value of these textbox , but i haven't click on tabs , the value is empty.if i click on the tabs on time , everything is ok.
what can i do?
thank you.
|
|
|
|
|
Move the code that fills the textboxes to the constructor of the form. There's probably an OnShow, OnActivate or an OnClick that does the databinding. Can you paste the code here?
Bastard Programmer from Hell
|
|
|
|
|
Hello people,
I'm making a software which will only allow a set of pre-defined programs I list, when it detects a "no no" process it terminates it. I made a text file that the program loads and tells it which processes which not to terminate and/or suspend, currently the list I have for that is (see below)
System
Interrupts
smss
Whenever a user wants to save his or her new settings, a form pops-up with UAC (user-account control) -like behavior, it suspends all processes except critical ones (the list above), it does this just in case the computer has been hacked or been unauthorized remote control (yeah I'm pretty serious about it) but whenever I tend to do this, it crashes the system. What would I like to know is which processes that should not be terminated or suspended or NOT BE TOUCHED all together, in order for the computer to not crash, so that the user doesn't have to force restart the computer, by unplugging the cord or holding the power-button for a few seconds.
Simple Thanks and Regards,
Brandon T. H.
Been programming in Visual Basic for 4 years this point forward, and is very good at it (I can even create programs completely on code, without dragging those items from the toolbox). Programming C++ for 1 year so far and the same with C#.
Many of life's failures are people who did not realize how close they were to success when they gave up. - Thomas Edison
|
|
|
|
|
Cute. You're going to have to investigate that yourself. The problem you have is that not every Windows installation is the same. Certain installation options will vary your list depending on whats installed.
Frankly, I think this is a waste of time as suspending process, even non-system ones, can cause problems. There's just no way you're going to be able to tell which process can and cannot be suspended.
|
|
|
|
|
(1.) Would you suggest just disconnecting the internet using the shell command:
Shell ("ipconfig /release", vbHide)
(2.) or disabling all network and I.p. devices.
(3.) Check the process really deep to make sure it's not connected to anything important, then if it's not do whatever I please to it. But if it is, freeze the non-important parts of the program.
Then re-enable anything that has been mess with (see above).
Simple Thanks and Regards,
Brandon T. H.
Been programming in Visual Basic for 4 years this point forward, and is very good at it (I can even create programs completely on code, without dragging those items from the toolbox). Programming C++ for 1 year so far and the same with C#.
Many of life's failures are people who did not realize how close they were to success when they gave up. - Thomas Edison
|
|
|
|
|
1 and 2 do nothing but stop all TCP/IP traffic on the network interfaces. They have nothing to do with stopping process or OK'ing a process to launch.
Brandon T. H. wrote: (3.) Check the process really deep to make sure it's not connected to anything
important
First, how do you define "anything important"?? Then, how do you think you're going to implement this "check"??
Brandon T. H. wrote: freeze the non-important parts of the program.
You've already been told: You're not going to "freeze" anything. Attempting to do so can have unforseen consequences in the system.
Windows already implements the goal of your application in Group Policy.
|
|
|
|
|
That is not practical, the list of typical processes is a moving target. It differs from one Windows version to the next, from one PC to the next, and from one moment to the next, as Windows, your AntiVirus SW, and a lot of applications get updated any way their vendor sees fit. Forget it.
What you might do is run Windows in kiosk mode (Google!), and write one app that offers the user exactly those operations you want available, no more, no less; it would launch allowed processes, the user would never launch anything through Windows, only through your one app (which may or may not require a lot of Windows Explorer functionality). No guarantees, as I've never done that (kiosk mode, that is).
|
|
|
|
|
The best advice is "do not do this". Unless you have a very clear understanding of the Windows operating system internals this will cause you nothing but pain; followed by a lot of anger from your customers.
Binding 100,000 items to a list box can be just silly regardless of what pattern you are following. Jeremy Likness
|
|
|
|
|
You should never suspend a process you don't know its purpose. By the way, if you suspend a process that own a resource, then other process won't have access to it so you can create deadlock particularly if you try to suspend a lot of processes and some process will have problems like timeout.
It is impossible to know what process are critical as it vary in time. Say you are printing, then if you suspend related process chances are that you will scrap the output. And it might get worst if a program is saving data to a file.
Philippe Mori
|
|
|
|
|
I am working on an MVC3 web application using VB, and need to have a countdown that updates itself on the page.
would highly appreciate any assistance for this.
|
|
|
|
|
Assistance with "what" exactly? Creating a countdown or displaying it? What have you tried?
I'd imagine that a simple JavaScript might do the trick. Does it need to do anything else when done with counting?
Bastard Programmer from Hell
|
|
|
|
|
I tried using javascript countdown but it does not work in my environment
yes it needs to inform the page when the countdown is over.
this is part of a timed quiz I am working on, and when the time is finished, it should provide feedback to the server part so that editing is stopped.
|
|
|
|
|
Member 8442750 wrote: I tried using javascript countdown but it does not work in my environment
That's where these things are usually done. What's wrong with the environment?
Does it allow VBScript? Seems that you'd want to do the counting on the client
Bastard Programmer from Hell
|
|
|
|