|
I think you can use Microsoft.Office.Interop.Excel.Workbook.PrintPreview method for this.
50-50-90 rule: Anytime I have a 50-50 chance of getting something right, there's a 90% probability I'll get it wrong...!!
|
|
|
|
|
I need to deploy a .NET 2.0 windows application so if no SQL Server found on the network, it will allow them to install SQL Express.
If there is SQL Server, then it will allow them to create a database with some baseline data.
Really need help on this,
Thanks,
Ekjon
|
|
|
|
|
Basically, my concern is - to create a database with 30/40 tables with some data in some of them - the sql statements would be large. What would be the best approach to deal with it?
|
|
|
|
|
Hello,
I am programming in vb2005
I have some pictures of a character that if you change them you got a movement of him. I write a small function that move the character when clicking on right arrow. THe images are in PNG format so it is good for the transparency. Then problem is when I put the characted on a image backkground I get jump of the picture.
How can I fix the problem?
Thank you
Shay Noy
|
|
|
|
|
What code have you got so far?
Hard answer unless we know the bigger picture.
------------------------------------
In science, 'fact' can only mean 'confirmed to such a degree that it would be perverse to withhold provisional assent.' I suppose that apples might start to rise tomorrow, but the possibility does not merit equal time in physics classrooms. Stephen J Gould
|
|
|
|
|
I don't understand your reply.
Have you understand my post?
Thank you
Shay Noy
|
|
|
|
|
[LOUD AND SLOW...]
Post the code you have written already
[/LOUD AND SLOW...]
------------------------------------
In science, 'fact' can only mean 'confirmed to such a degree that it would be perverse to withhold provisional assent.' I suppose that apples might start to rise tomorrow, but the possibility does not merit equal time in physics classrooms. Stephen J Gould
|
|
|
|
|
Imports system.Reflection
Public Class Form1
Private arrLeft(5) As Bitmap, arrRight(5) As Bitmap
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
arrLeft(0) = My.Resources.L1 : arrLeft(1) = My.Resources.L2 : arrLeft(2) = My.Resources.L3
arrLeft(3) = My.Resources.L4 : arrLeft(4) = My.Resources.L5 : arrLeft(5) = My.Resources.L6
arrRight(0) = My.Resources.R1 : arrRight(1) = My.Resources.R2 : arrRight(2) = My.Resources.R3
arrRight(3) = My.Resources.R4 : arrRight(4) = My.Resources.R5 : arrRight(5) = My.Resources.R6
End Sub
Private Sub Form1_KeyDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown
Static ind As Integer, LastDir As String
Static counter As Integer
Select Case e.KeyCode
Case Keys.Left
If LastDir = Keys.Right Then ind = 0 : counter = 0
If counter Mod 5 = 0 Then
PictureBox1.Image = arrLeft(ind Mod 6)
Application.DoEvents()
PictureBox1.Left -= 10
ind += 1
End If
LastDir = Keys.Left
Case Keys.Right
If LastDir = Keys.Left Then ind = 0 : counter = 0
If counter Mod 5 = 0 Then
PictureBox1.Image = arrRight(ind Mod 6)
Application.DoEvents()
PictureBox1.Left += 10
ind += 1
End If
LastDir = Keys.Right
End Select
counter = counter Mod 21 + 1
End Sub
End Class
Shay Noy
|
|
|
|
|
Hello, I'm totally new to VB and I need some help on creating a custom date format script for a label printer.
The date format is 3 alphanumeric characters (e.g 9BO, 9=year 2009, B=month 11 and O=day 24). The first character represents the year, the 2nd character represents the month and the 3rd character represents the day (day = 1-V with V being day 31).
Any help would be greatly appreciated.
Thanks
|
|
|
|
|
Did you try something? Where are you stuck up ?
|
|
|
|
|
Isn't this a case of converting the numbers of the year, month and day to base 36?
Try here.[^]
Steve Jowett
-------------------------
Real programmers don't comment their code. If it was hard to write, it should be hard to read.
|
|
|
|
|
I am currently trying to make a program that will read in a text file full of records and then allow the user to add or edit
the data. Basically like a database. Well i am trying to set up my queries right now, I am just trying to Sort by Last name and then display all the records in ascending order. the data is passed into 4 different text boxes though, one for FIRST NAME, LAST NAME, PHONE NUMBER, and GPA, SO when the user clicks a NEXT button he/she can view each record sorted by LAST NAME.
My problem i am having though is that when the user clicks the SORT by LAST NAME button it does sort but SPITS OUT THE LAST RECORD of the LIST instead of one at a time and then when he/she tries to click the NEXT BUTTON it just goes to End of File instead of showing the correct sorted list one at a time. CAN SOMEONE PLEASE TELL ME WHAT I AM LEAVING OUT OR NOT DOING RIGHT?
here is my sort routine:
Public Sub btnDisplaySorted_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDisplaySorted.Click
Dim sortedLastName = From names In students Order By names.lastName Ascending Select names
For Each element In sortedLastName
txtFirstName.Text = element.firstName
txtLastName.Text = element.lastName
txtG.Text = element.gpa
txtPhone.Text = element.tele
Next
End Sub
and my Next button routine:
Public Structure student 'structure used to hold fields in student list
Dim lastName As String
Dim firstName As String
Dim tele As String
Dim gpa As Decimal
End Structure
'GLOBAL Variables needed for entire program
Public students As New List(Of student) 'create list of students
Public oneStudent As New student 'creates a place holder for one selected student
Private Sub btnNext_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnNext.Click
Dim i As Integer
For i = 0 To students.Count - 1
Dim fname As String = students(i).firstName
Dim lname As String = students(i).lastName
txtFirstName.Text = fname
txtLastName.Text = lname
txtG.Text = oneStudent.gpa
txtPhone.Text = oneStudent.tele
Next i
End Sub
|
|
|
|
|
As far as i can tell you seem to be going about this the wrong way. Once you have read the textfile and parsed
the text into student objects, add each student to the list. To sort the list you have 2 options
1. Implement IComparer in your student structure like so :
Private Structure Student
Implements IComparable
Public lastName As String
Public firstName As String
Public tele As String
Public gpa As Decimal
Public Function CompareTo(ByVal obj As Object) As Integer Implements IComparable.CompareTo
If TypeOf obj Is Student Then
Dim otherStudent As Student = DirectCast(obj, Student)
Return Me.lastName.CompareTo(otherStudent.lastName)
Else
Throw New ArgumentException("object is not a student")
End If
End Function
End Structure
then once you have assmebled the list of students you can just call
Students.Sort()
and your list will automatically be sorted.
2. If you have to use LinQ (I take it this is homework) then you need to implement a function that returns a sorted list of students like so :
Private Function SortWithLinQ(ByVal StudentList As List(Of Student)) As List(Of Student)
Dim newStudentList As New List(Of Student)
Dim sortedLastName = From names In StudentList Order By names.lastName Ascending
For Each element In sortedLastName
newStudentList.Add(element)
Next
Return newStudentList
End Function
and then once you have assembled your list you call
Students = SortWithLinQ(Students)
and then you can implement the logic to scroll through the students.
Hope this helps.
|
|
|
|
|
zimvbcoder, THanks for your help the sort function worked perfectly!
I am still not to sure on the next click event though.
I was trying this:
Private Sub btnNext_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnNext.Click
Dim i As Integer
For i = 0 To students.Count - 1
Dim lname As String = students(i).lastName
txtLastName.Text = lname
Next i
End Sub
I am currently just passing the new last name to the text box after the user clicks next to see if it will indeed go to
the next record that has been SORTED already and display the last name. But i realized that the variable lname will overwrite
the data being passed to it until it reaches end of file so It always only displays the lastname of the Sorted list. I know that each index would have to passed but i can't just do something like students(0).lastname and then send it out the the textbox because the user can add to the file and so I wouldn't be able to determine how long the list is. What would I need to do?
|
|
|
|
|
You need to declare 3 class variables in your form class.
private currentStudent as student
private intCurrentRecord as integer
private intRecordcount as integer
While loading the records you need to increment intRecordcount for each record.
When finished loading the student records set intCurrentRecord to 0.
You then need to declare a function to set the records i.e.
Private Sub SetRecord()
If intRecordCount >= 0 Then
currentStudent = Students(intCurrentRecord)
txtFirstName.Text = currentStudent.firstName
txtLastName.Text = currentStudent.lastName
txtTele.Text = currentStudent.tele
txtGPA.Text = currentStudent.gpa
End If
End Sub
After setting intCurrentRecord call SetRecord which will give you the first student
loaded into the text boxes.
Ideally, instead of just a next button for scrolling through the records, you should
have 4 buttons, i.e Next, Previous, First, and Last buttons.
In each of these button events, increase or decrease intCurrentRecord as appropriate,
and then call SetRecord. i.e.
Private Sub btnNext_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnNext.Click
If intCurrentRecord < intRecordCount - 1 Then
intCurrentRecord += 1
SetRecord()
End If
End Sub
Private Sub btnPrevious_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPrevious.Click
If intCurrentRecord > 0 Then
intCurrentRecord -= 1
SetRecord()
End If
End Sub
Private Sub btnFirst_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnFirst.Click
intCurrentRecord = 0
SetRecord()
End Sub
Private Sub btnLast_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLast.Click
intCurrentRecord = intRecordCount - 1
SetRecord()
End Sub
Hope this helps
|
|
|
|
|
zimvbcoder, Thanks for all your HELP!!! I appreciate all ur help and time.
|
|
|
|
|
|
Hello to all,
Actually i m selecting the Font of Monotype Corsiva with the Style of Reguler. but after selecting it works for Italic.
Code is Given below. Valuefont is Fontdialog box .
If valuefont.ShowDialog = Windows.Forms.DialogResult.Cancel Then Exit Sub
font1 = New Font(valuefont.Font.Name, valuefont.Font.Size, valuefont.Font.Style)
Try to get the answer. why.
If you can think then I Can.
|
|
|
|
|
What are the values of those 3 variables you're passing in to the Font constructor? What does the code look like that's defining those variables and values?
|
|
|
|
|
Check the code which is give above. In Which Valuefont is dialogbox. And the value is passed from Dialog Box. The Error is generating while we select Morovia Corica and Select Style Regular.
If you can think then I Can.
|
|
|
|
|
That doesn't answer the question. Have you VERIFIED what those values are?
|
|
|
|
|
You Can Check For
Try
{
Dim Font1 as Font = New Font (Monotype Corsiva,12,Regular)
}
Catch
{
}
If you can think then I Can.
|
|
|
|
|
|
Why would you need a "SOAP interface" to store data in a database? There's something you're not saying about your concept that needs to be explained for this to make any sense. I mean, a login screen just takes a username and password. It's simple to lookup a username and compare the password enter to the one stored, wihtout using SOAP at all.
|
|
|
|
|
It's not a login screen on a website. I am creating a touch screen to login to when you enter an office.
|
|
|
|