|
Hi folks,
I am kinda new to this .NET world. I am basically trying to inherit datagrid and create a class library with custom events and functions. Everything works fine expect when i make anychanges to the datagrid properties in design mode using the properties window. It comes up saying 'Object not set to an instance'. I am able to manipulate the code programatically, but not able to set any properties to my derived datagrid control in desing mode.
Did anybody had any similar experience??
|
|
|
|
|
The following code are printing the selected row from a fleggrid:
srow = fgrid1.Row
Col = fgrid1.Col
For i = 1 To (fgrid1.Cols - 1)
Printer.Print fgrid1.TextMatrix(0, i) & ": " & fgrid1.TextMatrix(srow, i)
Next
I can't figure out how to print all row from a grid. Please help me
|
|
|
|
|
Try this code
Private Sub Cmdprint_Click()
'grdDetailReport(Name of the grid control)
Dim i As Integer
Dim defaultGridStyle As Integer
Dim defaultFixedGridStyle As Integer
Dim picGrid As StdPicture
Dim defaultFontsize As Single
' Initalize Variables
hl = grdDetailReport.HighLight ' Save current settings.
tr = grdDetailReport.TopRow
lc = grdDetailReport.LeftCol
X = 0
Y = 0
defaultGridStyle = grdDetailReport.GridLines
defaultFixedGridStyle = grdDetailReport.GridLinesFixed
Printer.Orientation = 2
Printer.Font.Size = 18
Printer.Font.Bold = True
'Printer.Print label1.Caption
grdDetailReport.Redraw = False
' Highlight off
grdDetailReport.HighLight = 0
Printer.Font.Size = 10
Printer.Font.Bold = False
Do Until X - grdDetailReport.Rows >= -2
X = X + 45
Y = Y + 1
Printer.Print "Page " & Y
If X > grdDetailReport.Rows - 1 Then
grdDetailReport.Row = X - 44
grdDetailReport.Col = 0
grdDetailReport.RowSel = grdDetailReport.Rows - 1
grdDetailReport.ColSel = grdDetailReport.Cols - 1
Else
grdDetailReport.Row = X - 44
grdDetailReport.Col = 0
grdDetailReport.RowSel = X
grdDetailReport.ColSel = grdDetailReport.Cols - 1
End If
For i = grdDetailReport.FixedRows To grdDetailReport.Rows - 1
If i < grdDetailReport.Row Or i > grdDetailReport.RowSel Then
grdDetailReport.RowData(i) = grdDetailReport.RowHeight(i)
grdDetailReport.RowHeight(i) = 0
End If
Next
For i = grdDetailReport.FixedCols To grdDetailReport.Cols - 1
If i < grdDetailReport.Col Or i > grdDetailReport.ColSel Then
grdDetailReport.ColData(i) = grdDetailReport.ColWidth(i)
grdDetailReport.ColWidth(i) = 0
End If
Next
' Scroll to top left corner.
grdDetailReport.TopRow = grdDetailReport.FixedRows
grdDetailReport.LeftCol = grdDetailReport.FixedCols
' Copy picture.
Clipboard.Clear
On Error Resume Next
grdDetailReport.PictureType = 0 ' Color.
Clipboard.SetData grdDetailReport.Picture
If Err <> 0 Then
grdDetailReport.PictureType = 1 ' Monochrome.
Clipboard.SetData grdDetailReport.Picture
End If
With flxGrid
Set picGrid = Clipboard.GetData(vbCFBitmap)
End With
grdDetailReport.GridLines = defaultGridStyle
grdDetailReport.GridLines = defaultFixedGridStyle
Printer.PaintPicture picGrid, Printer.CurrentX, Printer.CurrentY
Printer.NewPage
' Restore control.
For i = grdDetailReport.FixedRows To grdDetailReport.Rows - 1
If i < grdDetailReport.Row Or i > grdDetailReport.RowSel Then
grdDetailReport.RowHeight(i) = grdDetailReport.RowData(i)
End If
Next
For i = grdDetailReport.FixedCols To grdDetailReport.Cols - 1
If i < grdDetailReport.Col Or i > grdDetailReport.ColSel Then
grdDetailReport.ColWidth(i) = grdDetailReport.ColData(i)
End If
Next
grdDetailReport.TopRow = tr
grdDetailReport.LeftCol = lc
Loop
' Print commands
Printer.EndDoc
' Restore grdDetailReport
grdDetailReport.HighLight = hl
grdDetailReport.Redraw = True
End Sub
|
|
|
|
|
I copyed your code into my program and it working only 50 %.
1. When I select the first row it is printed fine, but when I am trying to print the next selected row it fails(nothing happend).
2. Also it is printing the only visible column what about the invisible columns?
Thanks
|
|
|
|
|
in keypress event i can check keyascii to see what a user has pressed but it doesnt include up/down/right/left.
Anyone know how i can catch these please ?
Many thanks
|
|
|
|
|
You have to use the KeyDown event because the KeyPress event only registers keys that represent characters.
"Do unto others as you would have them do unto you." - Jesus
"An eye for an eye only makes the whole world blind." - Mahatma Gandhi
|
|
|
|
|
Hi all,
I have a process that run lame.exe to encode an mp3. What I am trying to do is catch the ouput from lame and display it in a textbox. So what i did was this:
<br />
'create a new process<br />
Dim p As New Process()<br />
p.StartInfo.RedirectStandardOutput = True<br />
p.StartInfo.UseShellExecute = False<br />
p.StartInfo.FileName = "C:\Lame\encoder.bat"<br />
p.StartInfo.WindowStyle = ProcessWindowStyle.Hidden<br />
p.Start()<br />
p.WaitForExit()<br />
mainForm.txtResult.Text = p.StandardOutput.ReadToEnd<br />
p.Close()
This doesn't produce any errors, but it doesn't work either. I basically just want to show the user that something is happening. Ideally I would like to have a progressbar but i can't think of a way to measure the progress of the process. Anyway, if you can help that would be much appreciated.
/**
* @author Jachin
*/
|
|
|
|
|
Hi, trying to make an instalation with package and deployment wizard and everything seams to work fine but there is one smal question.
I would like to install a usb driver together with my aplication witout the need to insert the USB device. I have a .inf for the device file but how to run/install this with visual basic code from the pack.&dep. project?
regards Me
|
|
|
|
|
I have an application that has a web browser control (VB6) in a vb.net app. How can I write a javascript action that will call a function/sub or fire an event in the vb.net app containing the browser control. e.g. htm source code: <input type="button" value="Test" onclick="CodeThatWillPassIntoVBApp('DataToSendToApp')">.
<script>
function CodeThatWillPassIntoVBApp(DataToSendToApp)
{
//As if by magic - data is sent to vb.net app
}
</script>
Jim
|
|
|
|
|
|
Hello all,
I have an Access 2000 database. On a table called "Images" I have a field called "Link to Images." This field is hyperlink to some imgae files I have. The hyperlink name is generated based on an ID number given to them as they are entered to the database (the number increases sequentially).
I made a program that will take the ID number of it and create the appropriate hyperlink name. The problem is though, it doesn't create an actual hyperlink. The field gets changed to what I want, but it is not an ACTUAL hyperlink to the file.
Is there a way to write a program that will automatically create the hyperlink? I don't want to sit and manually type the name of 900+ images into my database.
Nickone
nickmthughes@hotmail.com (just in case you have a question)
|
|
|
|
|
Anonymous wrote:
The field gets changed to what I want, but it is not an ACTUAL hyperlink to the file.
What do you mean by this? What makes it not be an actual hyperlink? The fact that it isn't clickable? If so, all you have to do is change the data type to hyperlink in the table's design view.
"Do unto others as you would have them do unto you." - Jesus
"An eye for an eye only makes the whole world blind." - Mahatma Gandhi
|
|
|
|
|
Sorry maybe I wasn't clear. I wrote a Standard EXE VB program that connects to my database. In the Database, I have a field that are hyperlinks. Thus if I open the table, and click on the hyperlink, it opens the image.
So let's say I open my Table, and run the code, then I can see the hyperlink name change to what I want. My problem exists where when I go back and click on the link, nothing happens.
So I right clicked on the hyperlink in the Table and looked at the Hyperlink properties. The "Text to Display" has been changed by my program, but the hyperlink itself is blank. Basically the hyperlink is there, but it no longer actually links to anything. If I go through and reenter the hyperlink manually this way, it defeats the purpose of my program.
Any ideas?
It'd be really great if I could get this to work.
Thanks
Nick
nickmthughes@hotmail.com
|
|
|
|
|
Could you post the code you use to actually do the changing?
"Do unto others as you would have them do unto you." - Jesus
"An eye for an eye only makes the whole world blind." - Mahatma Gandhi
|
|
|
|
|
I have the flexgrid. When the row is selected I am assigning value to the text box array.
Text1(0).Text = fgrid1.TextMatrix(Y, 1)
As you can see I am taking each column and assign the value to a text box.
instead of assigning the value of each column to a text box is it any other way to do it?
|
|
|
|
|
|
me?
Notorious SMC
The difference between the almost-right word & the right word is a really large matter - it's the difference between the lightning bug and the Lightning
Mark Twain
Get your facts first, and then you can distort them as much as you please
Mark Twain
|
|
|
|
|
|
No, u.
then me. right?
Vilas Shewale
|
|
|
|
|
I am working on an image editing application, and I was getting a noticeable screen flicker. Is there a way to override the WM_ERASEBACKGROUND message that gets sent during a Refresh? I have a bitmap in memory that I am copying to the screen, so erasing the background during a Refresh doen't do anything besides irritate me.
I have come up with a workaround - I created my own screen painting subroutine and changed some of the Refreshes, Invalidates and InvalidateRgns to run my subroutine instead, but I still would like to know if there's some flag somewhere that you could set.
To not know is bad.
To not wish to know is worse.
|
|
|
|
|
Hello everyone,
I am having a crazy problem, and cannot find anything on the Internet
as to why this is happening.
I have a project folder, in which I have a Database folder.
+Project (Folder)
Project files (forms)
+Database (Folder)
Database files
+XML (Folder)
When I make an OLEdbConnection from a form in my project files folder, the absolute
path looks like this
D:\Documents and Settings\j\Desktop\DEVELOPMENT\GradID\Database\GradIdentDB.mdb
when I test the connection, it works.
however, I want it to be a relative link so I set it up like this since I am
in the project folder and want to go down into the database
folder.
.\Database\GradIdentDB.mdb
However, when I test the connection I get this error.
D:\Documents and Settings\j\Desktop\DEVELOPMENT\GradID\Database\Database\GradIdentDB.mdb
Notice the two "Database" in a row, it's as if my project is in the Database
folder. Understand?
The relative link that works is .\GradIdentDB.mdb
Again, it looks like Visual Studio thinks my form is in the Databse folder,
but it isn't, it is in the Project Folder.
Someone suggested making sure my output path as /bin, mine says bin/, and
when I tried to change it to /bin, VS.NET turned it back to bin/
Anyone know how to fix this?
Also, another similar problem creeps up when I import names from an Excel
sheet, say the Excel sheet is in the C:\ root, I'll get an error that says
my path to my .mdb is invalid.
In other words it stops looking here
D:\Documents and Settings\j\Desktop\DEVELOPMENT\GradID\Database\GradIdentDB.mdb
and starts looking here
C:\Database\GradIdentDB.mdb
if the Excel sheet is in the D:\ root
then it start looking here for my .MDB.
D:\Database\GradIdentDB.mdb
this makes no sense at all.
Any help would be great.
thanks,
Jason
|
|
|
|
|
You are going to need to modify your connection string. This is done most easily by modifying the " Windows Form Designer generated code " - you know, the stuff you're not supposed to change.
1. Search for "ConnectionString" in the hidden text.
2. In that mighty long string, find "Data Source=". This will give you the full absolute path. I think you can just change out the full path to your relative one. Otherwise you can set the path to 'Application.StartupPath & "\Database\GradientDB.mdb"'
To not know is bad.
To not wish to know is worse.
|
|
|
|
|
Hi, I have a problem with drag and drop: every sample about it i have found shows only how to drag a text from a textbox to another or a listview/treeview item to another. Instead, I have some controls (some shapes) and i need to allow to the user to drag them over the form like the visual studio IDE, with the resizing handles, the drawing of the dragged control's border, etc... exactly how the IDE! Can anyone help me, showing some samples (in vb.net or c#)?
|
|
|
|
|
hi if i make a bbox to ask the user how many text boxes they will need, how do I use the number the user inputs to create that many textboxes?
|
|
|
|
|
I am writing an automation program which has a form that displays a bunch of values. There is a program (class) which runs in the background and updates the form. I would like to place a button on the form which should pause the program (class) from running until the user says it is OK to continue. Unfortunately by running the code in the background, it no longer recognizes the form. (I click on the button and nothing happens). Does anyone know of an easy way to have the button have control when pressed (take away control from the class?). Thanks for any help!
Kogorman
|
|
|
|