|
My question is about that I want to change this demo's menustrip's font? How can I change? https://www.codeproject.com/Articles/18429/An-XML-Driven-Menu-Strip
Thank you for helping!!! 
|
|
|
|
|
|
Hello,
how can I change the fomat from the
Worksheets(Db).Cells(uGeraet, 1).Value to add it to the sheetname.
Whole code sample:
Sheets.Add
ActiveSheet.Name = "Example" & Worksheets(Db).Cells(uGeraet, 1).Value
Thanks
|
|
|
|
|
ActiveSheet.Name = "Example" & Worksheets(Db).Cells(uGeraet, 1).Value.ToString()
|
|
|
|
|
i have developed software in vb language for agriculture field. Software is design basic sprinkler irrigation system and calculate tentative quot for that design. please give some software details which is done in same subbejects.
|
|
|
|
|
We still do not do your homework: it is set for a reason. It is there so that you think about what you have been told, and try to understand it. It is also there so that your tutor can identify areas where you are weak, and focus more attention on remedial action.
Try it yourself, you may find it is not as difficult as you think!
If you meet a specific problem, then please ask about that and we will do our best to help. But we aren't going to do it all for you!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Member 13451330 wrote: please give some software details which is done in same subbejects
That is called research and this is the wrong place to do that research. You need to search for the existing software and papers on that software design in the subject you are supposed to be learning about.
Once you have found the details you need and if you have trouble with the coding then feel free to ask those questions here.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Please tell mi the software developmnt in agriculture sector with vb language. I am agriculture student persuing masters in Irrigation Water Management from Govt university. i have done Sprinkler irrigation design software but i need more help regarding with irrigation and vb language.
|
|
|
|
|
We do not do your homework: it is set for a reason. It is there so that you think about what you have been told, and try to understand it. It is also there so that your tutor can identify areas where you are weak, and focus more attention on remedial action.
Try it yourself, you may find it is not as difficult as you think!
If you meet a specific problem, then please ask about that and we will do our best to help. But we aren't going to do it all for you!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
I have 2 tables in the same database.
tblAircraft - ACID, ACName
tblMaster - MasterID, ACID, and many others that are not relevant to my question.
tblAircraft is a lookup table with all the aircraft listed. tblMaster is the main table and holds all the detail information.
I have a DataGridView that has several columns. Column 1 is a combobox column that has the ACName from tblAircraft. The rest of the columns are textbox columns with data from tblMaster. My application works as far as displaying all the data and I can use a dataadapter update command to update tblMaster (good) and the other datasource updates tblAircraft (bad) with the DataGridView. My problem is that I want ACID in tblMaster to be updated with the ACID from the combobox. Of course it won't because it belongs to the datasource for tblAircraft. How can I use the selection in the combo box to update the tblMaster table along with the other fields in the DataGridView?
I have spent hours and hours trying to figure this out. I hope my explanation is clear. Thank you in advance for any help you can provide.
<pre>
Private Sub cboAC_SelectionChangeCommitted(sender As Object, e As EventArgs) Handles cboAC.SelectionChangeCommitted
dsACGrid = LoadDataSet()
'Refreshes DataGridView
If dgvTasks.ColumnCount > 0 Then
For i As Integer = 0 To dgvTasks.ColumnCount - 1
dgvTasks.Columns.RemoveAt(0)
Next
End If
'Connection obj to database
Conn.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & Application.StartupPath & "\SupportGeneral.accdb"
Dim cbColumn As New DataGridViewComboBoxColumn With
{
.DataPropertyName = "ACName",
.DataSource = dsACGrid.Tables(1),
.DisplayMember = "ACName",
.DisplayStyle = DataGridViewComboBoxDisplayStyle.Nothing,
.Name = "cbColumn",
.HeaderText = "Aircraft",
.SortMode = DataGridViewColumnSortMode.NotSortable,
.ValueMember = "ACName"
}
dgvTasks.Columns.Insert(0, cbColumn)
Dim GSTask As New DataGridViewTextBoxColumn With {.DataPropertyName = "GSTask", .HeaderText = "Gen Spt Task"}
Dim LCOMTask As New DataGridViewTextBoxColumn With {.DataPropertyName = "LCOMTask", .HeaderText = "LCOM Task"}
Dim AFSC As New DataGridViewTextBoxColumn With {.DataPropertyName = "AFSC", .HeaderText = "AFSC"}
Dim ReqSkill As New DataGridViewTextBoxColumn With {.DataPropertyName = "ReqSkill", .HeaderText = "Req Skill"}
Dim ReqGrade As New DataGridViewTextBoxColumn With {.DataPropertyName = "ReqGrade", .HeaderText = "Req Grade"}
Dim NotesQuestions As New DataGridViewTextBoxColumn With {.DataPropertyName = "NotesQuestions", .HeaderText = "Notes/Questions"}
Dim AvgTimeHours As New DataGridViewTextBoxColumn With {.DataPropertyName = "AvgTimeHours", .HeaderText = "Avg Time-Hours"}
Dim CrewSizeMin As New DataGridViewTextBoxColumn With {.DataPropertyName = "CrewSizeMin", .HeaderText = "Crew Size Min"}
Dim CrewSizeMax As New DataGridViewTextBoxColumn With {.DataPropertyName = "CrewSizeMax", .HeaderText = "Crew Size Max"}
Dim Manhours As New DataGridViewTextBoxColumn With {.DataPropertyName = "Manhours", .HeaderText = "Manhours"}
Dim FreqQty As New DataGridViewTextBoxColumn With {.DataPropertyName = "FreqQty", .HeaderText = "Freq Qty"}
Dim FreqRate As New DataGridViewTextBoxColumn With {.DataPropertyName = "FreqRate", .HeaderText = "Freq Rate"}
Dim PAFSC As New DataGridViewTextBoxColumn With {.DataPropertyName = "PAFSC", .HeaderText = "PAFSC"}
Dim PAFSCQty As New DataGridViewTextBoxColumn With {.DataPropertyName = "PAFSCQty", .HeaderText = "PAFSC Qty"}
Dim AltAFSC1 As New DataGridViewTextBoxColumn With {.DataPropertyName = "AltAFSC1", .HeaderText = "Alt AFSC1"}
Dim AltAFSC1Qty As New DataGridViewTextBoxColumn With {.DataPropertyName = "AltAFSC1Qty", .HeaderText = "Alt AFSC1 Qty"}
Dim AltAFSC2 As New DataGridViewTextBoxColumn With {.DataPropertyName = "AltAFSC2", .HeaderText = "Alt AFSC2"}
Dim AltAFSC2Qty As New DataGridViewTextBoxColumn With {.DataPropertyName = "AltAFSC2Qty", .HeaderText = "Alt AFSC2 Qty"}
Dim AltAFSC3 As New DataGridViewTextBoxColumn With {.DataPropertyName = "AltAFSC3", .HeaderText = "Alt AFSC3"}
Dim AltAFSC3Qty As New DataGridViewTextBoxColumn With {.DataPropertyName = "AltAFSC3Qty", .HeaderText = "Alt AFSC3 Qty"}
Dim AltAFSC4 As New DataGridViewTextBoxColumn With {.DataPropertyName = "AltAFSC4", .HeaderText = "Alt AFSC4"}
Dim AltAFSC4Qty As New DataGridViewTextBoxColumn With {.DataPropertyName = "AltAFSC4Qty", .HeaderText = "Alt AFSC4 Qty"}
Dim ACSelected As New DataGridViewCheckBoxColumn With {.DataPropertyName = "ACSelected", .HeaderText = "Selected"}
With dgvTasks
.AutoGenerateColumns = False
.Columns.AddRange(New DataGridViewColumn() {GSTask, LCOMTask, AFSC, ReqSkill, ReqGrade,
NotesQuestions, AvgTimeHours, CrewSizeMin, CrewSizeMax, Manhours, FreqQty, FreqRate,
PAFSC, PAFSCQty, AltAFSC1, AltAFSC1Qty, AltAFSC2, AltAFSC2Qty,
AltAFSC3, AltAFSC3Qty, AltAFSC4, AltAFSC4Qty, ACSelected})
End With
'Bind the dataset after all operation to the datagrid
dgvTasks.DataSource = dsACGrid.Tables(0)
End Sub
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles Me.Load
Conn.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & Application.StartupPath & "\SupportGeneral.accdb"
'Loads dropdown for aircraft type
Dim strSQL As String = "Select * from tblAircraft"
Dim daAC As OleDbDataAdapter = New OleDbDataAdapter(strSQL, Conn)
daAC.Fill(dsAC, "tblAircaft")
Dim dr As DataRow = dsAC.Tables(0).NewRow()
dr("ACName") = ""
dsAC.Tables(0).Rows.InsertAt(dr, 0)
Using cmd As New OleDbCommand(strSQL, Conn)
With cboAC
.DataSource = dsAC.Tables(0)
.DisplayMember = "ACName"
.ValueMember = "ACName"
End With
End Using
dsAC.Tables.RemoveAt(0)
End Sub
Private Function LoadDataSet() As DataSet
Conn.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & Application.StartupPath & "\SupportGeneral.accdb"
'This code refreshes the datasets and data tables.
If dtACGrid.Rows.Count > 0 Then
dsACGrid.Tables.RemoveAt(0)
dtACGrid.Clear()
End If
If dtAircraft.Rows.Count > 0 Then
dsACGrid.Tables.RemoveAt(0)
dtAircraft.Clear()
End If
dsACGrid.Tables.Add(dtACGrid)
'Load Master table
strACGrid = "select * from tblMaster where ACName = '" & cboAC.SelectedValue & "'"
daACGrid = New OleDbDataAdapter(strACGrid, Conn)
cbACGrid = New OleDbCommandBuilder(daACGrid)
cbACGrid.QuotePrefix = "["
cbACGrid.QuoteSuffix = "]"
daACGrid.Fill(dtACGrid)
dsACGrid.Tables.Add(dtAircraft)
'Load Aircraft table
strACGrid = "select * from tblAircraft"
daACGrid = New OleDbDataAdapter(strACGrid, Conn)
cbACGrid = New OleDbCommandBuilder(daACGrid)
cbACGrid.QuotePrefix = "["
cbACGrid.QuoteSuffix = "]"
daACGrid.Fill(dtAircraft)
Return dsACGrid
End Function
Private Sub btnSave_Click(sender As Object, e As EventArgs) Handles btnSave.Click
daACGrid.Update(dtACGrid)
Me.Close()
End Sub
End Class
</pre>
|
|
|
|
|
This is a design issue, the way most of us settle it is not to allow editing in a complex (more than 1 or 2 editable fields) DGV.
I make the user doubleclick on the row that want to edit and pop a dialog box. An Add button allows you to pop an empty dialog box for entry.
Then save the AC details getting the ID as a return value, then save the detail record with the ACID.
Better still is to break your form into 2 forms, a list of aircraft and an Aircraft form with 2 areas, Aircraft details as the parent (single record) area with the details in the grid. User doubleclicks on the aircraft in the list form and the aircraft form displays, then the user maintains the Aircraft details in the top panel and doubleclicks the detail row to maintain.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I am creating a some PDF and Word docs on the fly, using itextsharp and an Aspose component for each respectively, importing some images. The raw images are 1000x1000 px, which is way too large - I need to fit two per page, above each other (and some text). I find they have to be no bigger than 300x300 for my requirements.
I can take two approaches:
1) import the images as are, and display them at 300x300 using appropriate object properties
2) re-size the images first to 300x300 then import these and display them at that size.
Approach 1) works beautifully. But with 14 such images the final product is over about 14MB - somewhat large for emailing.
Approach 2) works... but the image quality is lousy. Below is my code for re-sizing the images - my questions is:
Can this code be improved - and how come the docs can re-size them on the fly and retain such high quality, but this code is so bad?
The images are PNG's.
Private Function ResizePlayoutImage(ByVal sFile As String) As Boolean
Try
Dim FullSizeImage As System.Drawing.Image
FullSizeImage = System.Drawing.Image.FromFile(xmlPath & "Playout_images\\" & sFile)
If FullSizeImage.Width = 300 Then
FullSizeImage.Dispose()
If File.Exists(xmlPath & "Edited_images\\" & sFile) Then File.Delete(xmlPath & "Edited_images\\" & sFile)
File.Copy(xmlPath & "Playout_images\\" & sFile, xmlPath & "Edited_images\\" & sFile)
Else
Dim tmp As Bitmap
Dim gX As System.Drawing.Graphics
tmp = New Bitmap(300, 300)
gX = System.Drawing.Graphics.FromImage(tmp)
gX.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic
gX.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality
gX.PixelOffsetMode = System.Drawing.Drawing2D.PixelOffsetMode.HighQuality
gX.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighQuality
gX.DrawImage(FullSizeImage, 0, 0, 300, 300)
If File.Exists(xmlPath & "Edited_images\\" & sFile) Then File.Delete(xmlPath & "Edited_images\\" & sFile)
tmp.Save(xmlPath & "Edited_images\\" & sFile, System.Drawing.Imaging.ImageFormat.Png)
tmp.Dispose()
gX.Dispose()
FullSizeImage.Dispose()
End If
Return True
Catch ex As Exception
adp.WriteLog("ResizePlayoutImage", ex.Message & vbCrLf & sFile)
Return False
End Try
End Function
(PS there's something not quite right in the editor here, CP - NB I have to add a \ before any quotes or it messes up the display - but of course the code doesn't need that.)
modified 3-Oct-17 8:58am.
|
|
|
|
|
A_Griffin wrote: something not quite right in the editor here, CP - NB I have to add a \ Most likely because you have use language neutral <pre> tags round your code block. Use the code button to select the appropriate programming language.
|
|
|
|
|
|
some one please help me in designing database tables to record financial transactions in a central university in india. we are using double entry system. database shall be used for in-house development team.
M KAMIL
|
|
|
|
|
Have a look through these data structures
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi. I am developing a staff information form. How to retrieve staff information from Access Database after staff login? Which mean who login then it will display his information at second form.
Examples, staff A login, at the next form it will display staff A details. And staff B login it will display Staff B information.
|
|
|
|
|
1. Create a connection to the database.
2. Run a query against the correct tables.
3. Read the results of the query.
4. Display the results in a form.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
with rsOrder
.ActiveConnection = Conn
.ActiveConnection = sConnString
.CursorLocation = (adUseClient)
.CursorType = (adOpenStatic)
.LockType = (adLockBatchOptimistic)
'Conn.Open()
Conn.Close()
End With
If rsOrder.EOF Then (error at this line I dont know how I can use EOF in vb.net for windows application)
ValidateOrderID = Nothing
iCount = 0
Else
ValidateOrderID = rsOrder
iCount = 1
End If
|
|
|
|
|
If you're moving to .NET, you should be looking to replace the ancient ADODB with the built-in ADO.NET[^] instead. It will take some work to upgrade, but it will make things a lot easier in the long run.
As to the error, I suspect it might have something to do with the fact that you've closed the database connection before you try to read the query results.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
I check the connection but is not closed. I tried to avoid COM exception but did not get any success. I added few References also according to google search but nothing is working.
|
|
|
|
|
|
I need to specify a variable or text box in a SQL where clause. I am having a very difficult time replacing ‘IN PRODUCTION’ shown in the below code with a variable or test box. My desire is to use a variable, but is that is not possible a text box will do.
Below is the section of code with the WHERE clause. The query currently returns every item perfectly where the Status equals "IN PRODUCTION" What I would like to do is use a variable so that the same query can be used based on user selection.
FROM tbl_Switches WHERE Status = 'IN PRODUCTION' ORDER BY Node", cs)
|
|
|
|
|
What you need to look at is the SQL Parameters, to support parameterized queries. That way you can generate the SQL queries that look like this,
SELECT * FROM tble_Switches WHERE Status = @p1 ORDER BY Node
Now you will pass a parameter @p1 , which comes from a user input (combobox, or anything of your choice) and then you will finally get the records for that status.
Using SQLParameters with VB.NET/C#
SqlCommand.Parameters Property (System.Data.SqlClient)
Never try to build up a query by concatenation. You will expose the query to SQL Injection and that will only hurt; badly. SQL injection - Wikipedia.
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
how can i add user-agent to vlc player when playing rtsp server.
Set vlcControl = Controls.Add("VideoLAN.VLCPlugin.2", "vlcControl" & i)
vlcControl.Height = 6000
vlcControl.Width = 5000
x = Int(Rnd * 60)
Set vlcPlayer = vlcControl.object
vlcControl.Visible = True
ReqVideo = Text2.Text
vlcControl.object.playlist.Add ((ReqVideo))
vlcControl.object.playlist.play
vlcPlayer.audio.volume = 100
i will really appreciate it if anybody can tell me how i can add custom user-agents to this.
|
|
|
|
|