|
Not a good desgin, but it works.
|
|
|
|
|
I'm creating an application that launches a splash page when it is started. I want the splash to remain on the screen for 5 seconds and than it would disappear and the main form would appear. I have been playing around using the timer component but cannot seem to get it to work. Anybody know of a good tutorial for this or have advice on what to do as I'm a newbie?
Thanks
|
|
|
|
|
If you are working under Visual Studio 2005 then you can display the Splash screen just by going to the Project properties and on Application Tab just check the box 'Enable Application Framework' and choose your Splash Screen from the Splash Screen drop down and select the startup form from the
"Startup Object" drop down. No need to use timers here. But if you are not then just add a timer control to the form set its Enabled property to 'True' change the interval to '5000' for five seconds then in the Timer's Tick event just enter the following code:
Me.Timer1.Enabled = False
Me.Hide()
Dim frm_main as new MainForm()
frm_main.Show()
Hope it helps !
AliAmjad(MCP)
|
|
|
|
|
AliAmjad,
Thanks for the tips. I'm using a splash page but I still cannot get it close after 5 seconds. Any advice on how to do that which is what I was going to use the timer for as I was trying to get it wait for the timer to countdown and than close the form.
THanks again
|
|
|
|
|
I am writng an editable grid in my vb.net2005 project. The code is working fine but text box is not well positioned in the grid cell, for me to see what im entering in teh text box
im using something like this in teh FG_Keypress event
textbox.setbound(fg.left+fgcell.left,fg.top+fgcell.top,fgcell.width,fgcell.height)
any help will be appreciated.
t.aransiola
|
|
|
|
|
Why are you using the old FlexGrid?? What are you doing that will not let you use .NET 2.0's DataGridView??
|
|
|
|
|
i need an editable grid like Flexgrid in vb6.0. There is AXMSFlexgrid in .net 2005 that works like vb6.0 flexgrid just that the properties and methods arent teh same
See my code below, if there is any help u can render
thanks
positioning a textbox control in the grid cell
I am using this control in my vb.net2005 project
im using something like this in teh FG_Keypress event
Private Sub Fg_KeyPressEvent(ByVal sender As Object, ByVal e As AxMSFlexGridLib.DMSFlexGridEvents_KeyPressEvent) Handles Fg.KeyPressEvent
Select Case e.keyAscii
Case 13
e.keyAscii = 0
Fg.Focus()
Exit Sub
End Select
With Fg
' block the qty remaining column not to accept any entry
Select Case .Col
Case 0
EditBox.Enabled = False
Exit Sub
Case 1
'to upcase col1 cell entry
e.keyAscii = Asc(UCase(Chr(e.keyAscii)))
EditBox.Enabled = True
End Select
EditBox.Text = Chr(e.keyAscii)
EditBox.SelectionStart = 1
EditBox.Visible = True
'
'note: the problem is here,
'
EditBox.SetBounds(.Left + .CellLeft, .Top + .CellTop, .CellWidth, .CellHeight)
EditBox.Focus()
End With
btnSave.Enabled = True
End Sub
the code works fine but the EditBox wasnot well positioned as expected. I just converted this portion that is working in vb6 to vsb.net 2005. While typing i wouldnt see the text box, but once the fg gotfocused, the content displays on teh grid
t.aransiola
|
|
|
|
|
aransiola wrote: There is AXMSFlexgrid in .net 2005 that works like vb6.0 flexgrid
That's becuase it IS the VB6 FlexGrid. The "Ax" prefix give away the fact that it's an ActiveX control wrapped by a .NET interop class.
If all you're doing is putting up textboxs so you can edit fields, you don't need the FlexGrid. You just need to use the DataGridView instead and the default textbox columns, among others, are supplied automatically.
|
|
|
|
|
hi
You are right. We can use the datagridview control. But it is not working exactly as mshflxgrd works in vb 6.0.
I tried to use Datagridview
The main problem i faced is that I am not able to position the focus to the cell (that is to set other cell as the current cell when the data entry of one cell is completed and enter key is pressed) which i wanted at run time.
If you can help out this issue then hopefully we can use datagridview instaed of mshflxgrd.
If fact i am also in the process of converting my vb 6.0 application to vb.net
I am now stuck up with this issue. If you can help it out my time could be saved
thanks in advance.
|
|
|
|
|
How can I retreive non-key fields' values of Grid View Control in vb.net(I am using visual studio 2005).
|
|
|
|
|
Simply use SQL query based on conditon. You can read all the row of grid using GridviewRow class.
|
|
|
|
|
I am hoping this is a simple question to answer. I have done various searches for an answer but I am getting nowhere. Maybe I am not using the right key words. Anyway...
I am designing a POS system. Basically everything is done via buttons on a touch screen. But I would like to have the system also detect text input from a magnetic card reader. The readers are just simple HIDs that mimic a keyboard so the input device is of no real concern for this issue. As far as the computer is concerned the scanner is a keyboard.
I was thinking about having a text box that would await data to be entered and then run a subroutine when [enter] is detected. But I am running into two issues. 1) The textbox won't seem to take focus and wait for data. And 2) I don't know how to set things up to trigger a sub on the [enter] keystroke.
Any help would be highly appreciated.
Absenm
|
|
|
|
|
In order to detect the Enter key use the bellow code in the TextBox's KeyPress Event:
If e.KeyChar = ChrW(Keys.Return) Then
MsgBox("Enter key is pressed !")
End If
Hope it helps !
AliAmjad(MCP)
|
|
|
|
|
The scanner should give you some capability to prepend a character string to what it scans. For example if the code it see is 1234567890 , it should give you the ability to tell it to prefix the code with a character or two, like @123456789 is sent to your application.
Don't worry about the focus. The focus will change with every button that's pressed. On the Form, turn KeyPreview on. Handle the form's KeyDown event. In that event handler, check to see if the key being pressed is a "@", or whatever you want. If it is, then you can force the focus to the TextBox and let the rest of the keypresses through.
Oh, the scanner should also let to append a character to the string too, like ASCII 13 (ENTER).
|
|
|
|
|
This information is helpful and points me in the right direction, but I seem to be running into an error. Below is the test code I am using.
[CODE]
Private Sub Form1_KeyDown1(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
If (Me.KeyPreview = "q") Then
MsgBox("q")
TextBox5.Visible = True
End If
End Sub
[/CODE]
However, I am when I press the [q] key I get "System.InvalidCastException was unhandled. Conversion from string "q" to type 'Boolean' is not valid." Truth be told I have no idea what that means. Could you send a little code sample back my way. Thanks.
|
|
|
|
|
Absenm wrote: If (Me.KeyPreview = "q") Then
Ummm... You might want to lookup the docs on KeyPreview. It's not a property that get's the key, it's a True/False property you set to turn it on.
The KeyEventArgs has the key that is beind pressed, in its KeyCode property.
Private Sub Form1_KeyDown1(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
If e.KeyCode = Keys.Q Then
MsgBox("q")
' This line stops the key from beings seen by the control with the focus.
e.Handled = True
End If
End Sub
|
|
|
|
|
Yes, after doing further research and read a bit more at tbe .NET Framework Developer Center I figured out how to get my application to see keystrokes. I used something simular to what Dave suggested.
<br />
Private Sub Form1_KeyDown1(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown<br />
If e.KeyCode = Keys.G Then<br />
TextBox5.BringToFront()<br />
TextBox5.Focus()<br />
End If<br />
If e.KeyCode = Keys.Enter Then<br />
MsgBox("Complete")<br />
' Go to sub routine to process gift cards.<br />
End If<br />
End Sub<br />
It works pretty good but I wish I could figure out what the keycodes are for percent sign and question mark as these are the anchor characters on our gift cards magnetic strips.
|
|
|
|
|
There is no "%" key on the keyboard, is there?? It's the "5" key with the Shift key held down, isn't it?? So...
If e.Modifiers = Keys.Shift AndAlso e.KeyCode = Keys.D5 Then
Debug.WriteLine("Shift 5 detected!")
e.Handled = True
End If
If you want to find out what key was pressed, just put
Debug.WriteLine(e.KeyCode.ToString())
just before the If statement.
|
|
|
|
|
Dear all
fine
I want to write code to generate serial hard disk , but I cannot do my own self so that if you can do . Please detail step to do it. Thanks you.
The best regard
From Sovy.
email: sovy_sim@yahoo.com
|
|
|
|
|
|
What do you mean by "generate serial hard disk"??
|
|
|
|
|
Hi everyone
I got a small problem I have devloped hotel software and I am trying to draw achart that shows %age occupancy. I would like to draw a pie chart on a form. I have managed to do this so far,the chart is being drawn when the form loads.
I would like the form to be able to redraw when a user specifies a different date such that you can view the past occupancy. The code I am using is shown below. I hope you will be able to help me.
twisted F8
Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
Dim TotalCount As Single
Dim rect As Rectangle = New Rectangle(100, 105, 150, 150)
For Each gd As GraphData In occupancy
TotalCount += gd.percentageocc
Next
Dim g As Graphics = e.Graphics
' Create variables to hold the changing values of Angles
g.SmoothingMode = Drawing2D.SmoothingMode.HighQuality
Dim StartAngle As Single = 0
Dim SweepAngle As Single = 0
For Each gd As GraphData In occupancy
SweepAngle = 360 * gd.percentageocc / TotalCount
g.FillPie(New SolidBrush(gd.Clr), rect, StartAngle, SweepAngle)
StartAngle += SweepAngle
Next
' g.DrawPie(New Pen(Color.Brown), rect, StartAngle, SweepAngle)
' Create a Brush to draw the text
Dim TextBrsh As Brush = New SolidBrush(Color.Black)
' Create a Font object instance for text display
Dim TextFont As New Font("Arial", 12, FontStyle.Bold)
g.DrawString("Chart Key", TextFont, TextBrsh, 310, 100)
Dim pxFromTop As Integer = 135
For Each gd As GraphData In occupancy
' Draw bullet
g.FillEllipse(New SolidBrush(gd.Clr), 310, pxFromTop, 15, 15)
' Draw line round bullet.
g.DrawEllipse(New Pen(Color.Black), 310, pxFromTop, 15, 15)
' Draw the text - color coded
g.DrawString(gd.Description & " (" & gd.percentageocc & "%)", TextFont, TextBrsh, 360, pxFromTop)
' Increase gap from Top for next line
pxFromTop += 30
Next
End Sub
|
|
|
|
|
I think Form.Refresh() method will do the job for you.
AliAmjad(MCP)
|
|
|
|
|
Hi,
some remarks:
1. You can force a redraw by calling Invalidate() on the Control that does the drawing,
in your case a Form.
2. Please, please publish code snippets inside PRE tags; it reads much better.
3. You must call Dispose() on those objects that you create and havre such a class,
as in SolidBrush and Pen.
4. For predefined colors there also exist predefined objects (Pen, Brush), see
Pens class and Brushes class. You should not try to dispose these, since you did not
create them!
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
hey,, i just want to ask on how to program a digital persona fingerprint scanner.
I've installed the SDK and the platinum integrator I've also followed the sample codes that are written in the manual but it still doesn't work...
can you help me with this problem??
|
|
|
|