|
misCafe wrote: (Error Message : Type mismatch)
Could that be caused by insurno being a number? Try converting it explicitly;
Set lvwItem = Me.lvwStaff.ListItems.Add(, , CStr(Rst![insurno]))
I are Troll
|
|
|
|
|
Thanks so much for your help. The problem is fixed.
Anyways, I want to click on the ListView Item and load its values from each colums to the TextBox, ComboBox. It is the better way to update the record.
Chuon Visoth
Angkor Wat - Cambodia
asp.net - c sharp beginner
|
|
|
|
|
You're welcome
I are Troll
|
|
|
|
|
Hope you guys can help, because I'm stumped on this one. Okay, so I have a VB.NET 2008 program I'm writing, I'm trying to load some PHP reports in a WebBrowser control. On one form there is a WB control and the different buttons for different reports, two of them have to be able to be filtered by date, user, etc., so on those another form opens up with those options. All of this works fine, the options set variables for use in the url to the report, but when I try to navigate to the the report's url, the WB control does nothing.
I figure I need to reference the open instance of the child form with the browser on it, but I haven't been able to find how to do that.
Anything you guys can help me with would be appreciated. Thanks!
|
|
|
|
|
You can access all the open forms in your application via the My.Application.OpenForms methods.
Expose a public method on one form and pass a variable across from the other form e.g. To pass a value to Form1 from Form2
Form1.SomeMethod(SomeVariable)
Then in the SomeMethod on Form1 build the new browser url and navigate to it.
|
|
|
|
|
don't know why, but I can't seem to get a value to pass across.
Public Function GetURL(ByVal report As String)<br />
Return report<br />
End Function
It just returns Null no matter what I put into it. Don't think I'm doing anything wrong but I might be, help me out please.
|
|
|
|
|
OmegaMaximum wrote:
Public Function GetURL(ByVal report As String)
Return report
End Function
aren't you missing the return type in your function header, example
Public Function GetURL(ByVal report As String) As String
Return report
End Function
|
|
|
|
|
Thanks for pointing that out, but it still won't work. After some testing with message boxes, I've found that it just seems to stop after the Return line. No matter what I put after the Return is ignored.
|
|
|
|
|
it will, the Return effectively steps out of the function as if to say, "i've done everything i need to do, now return to the caller"
|
|
|
|
|
Thanks for all your help guys, I got it to properly reference the opened instance of the form with this,
Dim f1 As frmMain_A_C = CType(My.Application.OpenForms("frmMain_A_C"), frmMain_A_C)
Thanks again for all the help!
|
|
|
|
|
Hi,
The default scrollbar of windows seems to be to narrow for the ListView i'm developing for the application, this is why i have created a custom ScrollBar. The question is how do i attach the scrollbar to the listview that when scrolled the listview will scroll.
Please advice.
Thanks
|
|
|
|
|
Why does it seem too narrow? it will be standard across the OS, if you try and change one scrollbar in your application, it will then look different to everything else and just seem a bit odd.
I don't know how to do it without spending hours searching the docs and google etc. So hopefully someone more knowledgeable will respond, but one method would be to set up your scrollbar relative to the number of items in the listview, and then when you scroll, change the listview.topitem property to simulate a scroll. You would have to monitor the listview changes also, as well as what to do if the user uses arrow up and down while listview has focus.
Seems way to much effort for something that you should not need to think about. i.e. leave the original scrollbars as is.
modified on Sunday, January 24, 2010 3:27 PM
|
|
|
|
|
Eli Nurman wrote: The default scrollbar of windows seems to be to narrow for the ListView
That doesn't make sense to me. Most scrollbars look the same in Windows. For some sizes, see SystemInformation class, the HorizontalScrollBarXyz and VerticalScrollBarXyz properties.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that. [The QA section does it automatically now, I hope we soon get it on regular forums as well]
|
|
|
|
|
OK. the width is the same everywhere, but i need for this app specifically a wide scrollbar
|
|
|
|
|
Hello to All,
Actually i am Developing application with Vb.net and C#. And My Next operation is Developing those application to MAC OS Environment.
So Please Help me for How to Develop those applcation to MAC Environment.I have not any idea of MAC.
THANKS
If you can think then I Can.
|
|
|
|
|
|
Install Mono[^]
I are Troll
|
|
|
|
|
Thank you sir How to Work WIth MONO.
If you can think then I Can.
|
|
|
|
|
Download and install Mono from here. A basic introduction on running a C# application using Mono can be found here.
I are Troll
|
|
|
|
|
I'm modifying code that was written 9 years ago in VB.Net and JavaScript.
I revised the code to successfully write to Excel but the javascript controls are now in the Excel file.
I'm receiving error: Value of typ 'system.Reflection.PropertyInfo' cannot be converted to 'Boolean'.
Private Sub ClearControls(ByVal control As Control)
For i As Integer = control.Controls.Count - 1 To 0 Step -1
ClearControls(control.Controls(i))
Next
If Not (TypeOf control Is TableCell) Then
If control.[GetType]().GetProperty("SelectedItem") IsNot Nothing Then
Dim literal As New LiteralControl()
control.Parent.Controls.Add(literal)
Try
literal.Text = DirectCast(control.[GetType]().GetProperty("SelectedItem").GetValue(control, Nothing), String)
Catch
End Try
control.Parent.Controls.Remove(control)
ElseIf control.[GetType]().GetProperty("Text") IsNot Nothing Then
Dim literal As New LiteralControl()
control.Parent.Controls.Add(literal)
literal.Text = DirectCast(control.[GetType]().GetProperty("Text").GetValue(control, Nothing), String)
control.Parent.Controls.Remove(control)
End If
End If
Exit Sub
End Sub
|
|
|
|
|
I would use a different approach - you know the underlying data so why not convert it to a CSV and download the file?
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
The former programmer did all in code queries and did not use datasets or data adapters. I plan to re-write the code but for now, I have to correct errors.
do you think that removing the javascript is not possible?
|
|
|
|
|
technette wrote: do you think that removing the javascript is not possible?
Sorry, I'm a winforms dev so my ASP knowledge is limited so naturally I look for a non ASP solution.
How did he get the data from the database if he did not use the data collections? He must have used a collection of some sort. I would find that collection and work with that.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
In ASP.Net you can write SQL queries and use a data connection in code to connect to the database just by creating the connection in web.config then referencing the connection on the code behind page. The programmer has each page written with connections, if then statments that, based upon the query, print to a "select" page.
I spend hours trying to reference a collection that would export directly to excel to no avail.
|
|
|
|
|
Ok so you have the tools to do this
Connection can be accessed from the code behind, the select statement is in the gridview somewhere, take that out to the code behind. Use these two to get a datatable and set it as the datasource for the gridview and databind it. That should give you the same functionality as you currently have and you now have access to the datatable.
Note: I've never used the database => control binding so I'm not sure if it will work but I use the database => DAL => code behind => control style and that gives me complete control over my data, and therefore I do not have this issue.
Never underestimate the power of human stupidity
RAH
|
|
|
|