|
Yes, you can set the properties to stretch the image, I believe. Or you can draw it yourself, in which case you can draw it to the size of the window.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Thank you
I modified the form_resize so that it will create a new bitmap with a new size everytime the form resizes, it's working now.
Thank you so much
-- modified at 22:08 Tuesday 15th November, 2005
|
|
|
|
|
I have a third-party DLL that I am importing into vb.net code that renders to a device context.
<psuedo>
Render(HDC, x, y, width, height, scale, rotation_angle)
</psuedo>
I like being able to use the matrix transformations of GDI+. This makes rotation and zooming and inheriting rotation and zooming easy.
However, if I use the graphics object of my drawing surface to change the transformation matrix, then pass the device context to the render function, the rotation does not take effect for the render function. I assume this is because the render function uses GDI and does not enter the GDI+ rendering pipeline.
I have tried drawing to a bitmap, then rendering the bitmap to my drawing surface, but at a significant reduction in quality.
Does any one have any ideas on how to improve on my work, or am I fighting a losing battle?
Kevin
|
|
|
|
|
I have an Access dB with a VB.net front-end that I can display, browse, and edit records in. This program can also search through the dB to find specific records. My search criteria is set to last name and the problem I am running into is...if I have three people with the same name listed in the dB and I do a search, all three names will show up as being records in the dB (which is correct so far). But when I click on one of the search results, they all go to the same record. What would be causing this? I have stepped through my code and it seems either the identifying part (PK) of the record is missing or just not being utilized by my code properly. Has anyone had this problem before? I am kind of looking for some guidance on this solution as I am out of answers. Thank you.
Jason
I'd rather have a bottle in front of me than a frontal lobotomy.
|
|
|
|
|
can you share a snippet, just to give us a good idea about your problem.
thanks!
Marvin N. Guerrero
- Taje Kage_bunshinNunJutsU
|
|
|
|
|
Here is the code for the btnSearch_Click event and then for the lstResults_SelectedIndexChanged event. I believe it is something w/in these sections. My opinion on the problem is that I am using a string in the lstResults_SelectedIndexChanged event and there is nothing to tie the search results with the actual records (unique ID). I don't know if I am wording this right but I somehow need to tie my search results into a unique ID (Primary Key of dB). Anyway, here is the code:
Private Sub btnSearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSearch.Click
'search the dataset for the record
Dim TotalRows As Integer
TotalRows = dsCards.Tables("Football Cards").Rows.Count
'if they have no active DataSet, refuse:
If dsCards.Tables.Count = 0 Then
MsgBox("please use the File menu to open a Dataset, or create a new one first.")
Exit Sub
End If
'search for the target, then display it
Dim searchfor As String = InputBox("Enter Your Search Term", "Search")
If searchfor.Length = 0 Then
Return
End If
lstResults.Items.Clear()
Dim i, x, count As Integer
For i = 0 To TotalRows - 1
x = dsCards.Tables("Football Cards").Rows(i).Item(8).ToString.ToUpper.IndexOf(searchfor.ToUpper) ' see if title column matches
If x <> -1 Then 'match
lstResults.Items.Add(dsCards.Tables("Football Cards").Rows(i).Item(8))
'add title field to listbox
count += 1
End If
Next i
If count = 0 Then 'no matches found
MsgBox("No match for " & searchfor & " was found...")
Else
lstResults.Visible = True
End If
End Sub
Private Sub lstResults_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lstResults.SelectedIndexChanged
'go to the selected record
Dim dr As DataRow, dt As DataTable
lstResults.Visible = False
Dim i As Integer = 0
Dim s As String
dt = dsCards.Tables("Football Cards")
s = lstResults.SelectedItem.ToString 'which item did they click?
'find their choice
For Each dr In dt.Rows 'search the dataset to find the correct Description
dr = dsCards.Tables("Football Cards").Rows(i)
i = i + 1
If dr(8).ToString = s Then
bmCards.Position = i - 1
Exit For
End If
Next
End Sub
Thank you!
jason
I'd rather have a bottle in front of me than a frontal lobotomy.
|
|
|
|
|
On my windows form I have a textbox and a datagrid. As I navigate through the grid's data how can I display the selected row of the first column in the textbox?
Thanks
|
|
|
|
|
There are many ways to extract information, first you need to identify the index of the record you want to extract.
We can use the ME.Databindingcontext( datasource ).position to identify the current row.
Normally we assign a table to a datagrid's datasource, but here we will use the Table.Defaultview.
SO given TBL1 as your datatable
Datagrid.datasource = TBL1.Defaultview
then we can use
Me.BindingContext(TBL1.DefaultView).Position()
to indentify the current row, this should work even it you change the sort field of the datagrid.
I think thats it.
Dim ID As String
'use the this event handle
Private Sub DataGrid1_CurrentCellChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles
DataGrid1.CurrentCellChanged
Dim x As Int16
'Datagrid1.datsource = tbl1.Defaultview
' instead of Datagrid1.datsource = tbl1
' you must explicitly point to the tables defaultview
'Get the position of the Table's Defaultview
x = Me.BindingContext(TBL1.DefaultView).Position()
'use x to identify you row
textbox1.text = TBL1.DefaultView(x)("fieldname")
End Sub
Marvin N. Guerrero
- Taje Kage_bunshinNunJutsU
Marvin N. Guerrero
- Taje Kage_bunshinNunJutsU
|
|
|
|
|
hi,
try this
TxtboxName.Text =
DataGrid1.Item(DataGrid1.CurrentRowIndex(), 0).ToString()
Live Life King Size
Asif
|
|
|
|
|
That will not work if the datasource is a sorted view.
|
|
|
|
|
Hi everyone, thank you for looking at my post. I have a problem when loading a combobox in a windows usercontrol/form. I attempt to populate the combobox, within my user control, when I load the other data within the form. When I populate the combobox with data, I cannot clear the combobox if there is matching selected index when it loads. After it loads and the user selects another item, the combobox filters and clears the index as needed. I populate as much of the data on the form when the form loads. The user controls are then populated based on the data populated on the form. This is where I have the problem. When the form and user controls load for the first time, the addtion of the datasource to the combobox does not allow me to clear set the index of the combobox to -1 if the first time on the form does not have related record to the data on the form. Thank you for your help.
Code:
#Region " Load Stuff "
Private Sub uc_companyCreditBankContact_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.ucCreditMediator = New tabCompany.CompanyCredit.uc_companyCreditMediator
Call Me.requery()
Call Me.populateComboAllTypes()
Me.recordStatus = cCreditBankContStatusType.none
'Call Me.enableCreditBankContact(False)
End Sub
#End Region
#Region " Requery "
Public Sub requery() 'Function that can be called from other forms/classes to populate the companyInfo data
ds1 = Me.ucCreditMediator.creditBankInfo.Copy 'Calls the mediator class to populate the ds
End Sub
#End Region
#Region " Populate Types/Comboboxes"
Private Sub populateComboAllTypes()
Call Me.CompanyBank_Populate()
Call Me.CompanyBankContact_Populate()
End Sub
Private Sub CompanyBank_Populate()
Me.comb_companyCreditBank.AddDataSource(ds1.Tables("tbl_CompanyBank"), "companyBankName", "companyBankId") 'Add a datasource to the company with display and value members
Me.comb_companyCreditBank.emptyIndex()
End Sub
Private Sub CompanyBankContact_Populate()
If Me.txtBankId.Text <> "" Or Me.txtBankId.Text <> "-1" Or IsNothing(Me.txtBankId) = False Then
Call Me.comb_companyCreditBankContact.AddDataSource(Me.ds1.Tables("tbl_CreditBankContact"), "creditBankContactFirstName", "creditBankContactId")
Call Me.comb_companyCreditBankContact.emptyIndex()
End If
End Sub
#End Region
|
|
|
|
|
Thank you to Andrew Vos for his great project.
(http://www.codeproject.com/useritems/StartButtonEx.asp[^])
One thin I would like to ad to it is to disable the OLD windows Start button completely ... So that pressing the win key on the keyboard or CTRL+ESC to bring up the new custom menu, or alternativly do just nothing.
Can this be done by a simple registry hack ? Or what Should I add / Modify ?
(New in VB.NET)
thank you in advance.
Wilhelm
|
|
|
|
|
There is no registry hack to turn that key off. The only solution is to write a low-level keyboard hook and have it look for that key make/break and eat those messages (not pass them along the koyboard hook chain).
I wrote just such a toy, in C++, a few years ago, but since my employer at the time owns the code, I can't give it to anyone.
I used this[^] article on MSDN as the basis for my design.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Please help me!!
I use Visual Basic for my application.
I have a Windows Forms application and I like to export a SQL server query to a csv file.
How can I do that?
Dennis
|
|
|
|
|
You can iterate through the datatable and write a CSV file from the rows.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Can you please give me an example code on how to do this?
I am pretty new with programming such an application!
Thanks in advance.
|
|
|
|
|
use foreach to iterate through the Rows collection of your table. You can then access each property in the row using row("columnName"). Here[^] is an article on how to write text files in VB.NET.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hello everybody!
can you help me :
if in VB 6 uses VBKeyK then what VB.Net uses?
Thanks!
|
|
|
|
|
What is VBKey ? Is it like the Keys enum ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Sorry i did'nt mention the IDE:
VB.NET 2003
PatriceB
|
|
|
|
|
Hello Guys,
I am trying to sign my assembly with a Strong Name.
When I try to build the program I get this nice error:
Preparing resources...
Updating references...
Performing main compilation...
vbc : error BC30145: Unable to emit assembly: Referenced assembly 'Interop.Scripting' does not have a strong name
Building satellite assemblies...
Satellite assemblies could not be built because the main project output is missing.
I am interested to know how we could sign the 'Interop.Scripting' assembly
Is there someone having a clue ?
Thanks by advance
Pat
PatriceB
|
|
|
|
|
Hello there
I have a toolbar on the form using vb.Net 2003 . When I disable the buttons it shows the image as a shadow. where I want image to be same like before. Can any one tell me how to resume the shape of an image on disabled button.
Rizwan Bashir
|
|
|
|
|
Dear all
I am working on a project in VB, where i required to monitor any changes in in files in the entire system and log the file name of the modified file on the fly.
Language : VB 6.0
Platform : WIN2K /WIN XP
Is there any way to get the the modified file names in real time (i.e as and when any changes are made to file like changing file content or overwriting etc in the entire system)
Any help in this regard is appreciated
Thanks in advance
Dinakara K
CAIR, Bangalore
|
|
|
|
|
Hi iam a beginnner
How can i decompress a file to a path
Explain simple please
Thanks
|
|
|
|
|
hi, this is ajay bharti
i have to use tdb or flexi grid in my vb.net project, i m using data set.
how to show data of data set in tdb or flexi grid , i need some code for that....please help me.
its very urgent.
hi this ajay bharti
|
|
|
|