|
Here they have mention how to select number of cells.
They havent mention how to Make multiple selection
Thanx
|
|
|
|
|
How to create multiple linklabel in RichTextBox at specific positions?
Like in a rich text box i have text and also at the end of some lines i want to add linklabels. Any solution or can u suggest any other control for doing this.
thanks
Sumit Domyan
|
|
|
|
|
Hello,
I need some help in image control. When I press the next button on the form the image should be change with next record and similarly with previous and last buttons.
|
|
|
|
|
what kind of a question is that?
|
|
|
|
|
You should change the Picture property of the image manually.
Image1.Image = Image.FromFile ("Image.gif")
|
|
|
|
|
|
I suppose that you use VB6 as the interface and ms access as the database. In you access file create the table that you want to store an image path. In that table suppost that you have many field with difference information in clude the field of the photo too. In the field of your photo, don't use OLE object as the data type. Use Text as the database instead of OLE Object . Then on your form when you want to select the picture you will use common dialog to open the picture that you want and return the string of the picture path. Use LoadPicture function in vb6 to load the picture base on the path to that picture. So when you add the record you will add the string of path to the image in your record.
Working with this way is save your database a lot of space instead of using an OLE Object . When you move back or next you just load the picture by using the path that store in the database. I used to do this before and its working very well
A thousand mile of journey, begin with the first step.
APO-CEDC
Save Children Norway-Cambodia Office
|
|
|
|
|
Hi All,
I have a VB6 project which uses OleCreatePictreIndirect to create a bitmap.
When this is converted to VB.NET (a change forced on me but IT services) it no longer seem to work. The code compiles but throws a;
SystemNullReferenceException: Object not set to instance of an object.
Code used is below and was originally sourced from the standard microsoft example.
Public Declare Function OleCreatePictureIndirect Lib "olepro32.dll" (ByRef PicDesc As PicBmp, _
ByRef RefIID As GUID, ByVal fPictureOwnsHandle As Long, ByRef IPic As IPicture) As Integer
Private Function CreateBitmapPicture(ByVal hBitmap As Integer, Optional ByVal hPalette As Integer = 0) As System.Drawing.Image
Dim r As Integer
Dim Pic As PicBmp
Dim IPic As IPicture
Dim IID_IDispatch As GUID
Dim PicTypeBitmap = 1
' Fill in with IDispatch Interface ID
ReDim IID_IDispatch.Data3(0)
ReDim IID_IDispatch.Data4(7)
With IID_IDispatch
.Data1 = &H20400
.Data4(0) = &HC0S '&HC0S
.Data4(7) = &H46S '&H46S
End With
With Pic
.Size = Len(Pic)
.Type = 1 'PicTypeBitmap
.hBmp = hBitmap
.hPal = hPalette
End With
MsgBox(Pic.Size)
MsgBox(IID_IDispatch.GetType.ToString)
' Create Picture object
r = OleCreatePictureIndirect(Pic, IID_IDispatch, True, IPic)
'Return the new picture
CreateBitmapPicture = IPic
End Function
I have read some posts stating that the OleCreatePictureIndirect has changed in .NET but as I have no .NET experience and no reference material, the detail given in the solutions is lost on me.
Could someone please explain in relatively plain english the situation and the solution???
Could you also recommend some good reference material for getting up to peed with .NET
Any help greatly appreciated
Cheers
Dave
|
|
|
|
|
Hello world
I've written an app that employs disconnected data via datasets. I had a situation lately where a user modified over 10 records (out of a total of 25 contained within my dataset). When the user tried to update the datasource with their changes some of those records violated database rules. The user then had to manually scroll thru the dataset SEQUENTIALLY to see which records caused the update to fail. How do I modify the app so that in such a situation it automatically displays the first record that causes the update to fail?
If it is any help, the app was built using the Data Form Wizard in VB.NET.
Rommel the iCeMAn,
Computer Programmer,
Barbados, West Indies.
|
|
|
|
|
I have a suggestion that u might wanna look at,
what you can do is to highlight those records that caused the problems and let user rectify.
BTW : I am curious, how can u let user update fields that can cause DB error? wanna leave an example here?
thx
"Rejoice always, pray without ceasing, in everything give thanks; for this is the will of God in Christ Jesus for you."1Thess. 5:16-18
|
|
|
|
|
You're thinking along the same lines as me. However, the question is, how does one determine which records are the rogues? For example, if we are sending 5 records back to the datasource but one has caused a concurrency violation, how do we know which one has caused the violation?
As for your question I think it's just a case of highlighting the field (on the data-entry form) that caused the error, allowing the user to correct the data, then allowing them to save the data again (via the appropriate command button on your form).
Rommel the iCeMAn,
Computer Programmer,
Barbados, West Indies.
|
|
|
|
|
Hi our company looking for a custom report generator where user can pick which columns to view on the report. Also they should able to resize the columsn to fit their need like PeachTree reporting.
|
|
|
|
|
I know there are a lot of sample for creating office addins or addins for microsoft product. Is there any sample to do the same thing for photoshop or other application?
Shinay
|
|
|
|
|
I am trying to add a column in a datagrid that I set up and I got that to work, but the problem I am having is trying to get Access to update and keep the new column on file. I am using Visual Studio .Net and am trying to get this to work in Visual Basic.
Bobby
underb@d20.co.edu
|
|
|
|
|
I just received a call to debug a TAPI problem.
The company that created the control no longer exists.
Problem: When the VB App finished making a call and downloading via modem, it closes the program without giving a reason. This only occurs on machines running Win2000 or WinXP. The program was origanaly written and tested on Win2000 (also tested on Win3.1, Win95 and Win98).
Could this have something to do with Windows security updates?
Any ideas would be helpfull.
INTP
|
|
|
|
|
Hi there,
I'm trying to create a DAL. Therefore I'm analyzing the DotNetNuke project and extracting code to create my own DAL. Thusfar I managed to talk to the database (with DataProvider.Instance). Now I'm trying to use a FillObject method, but I seem to be stuck at this point. I'm getting the following error 'System.Reflection.TargetException: Object does not match target type'. The error occurs in the sub CreateObject (last catch) at the following line 'CType(objProperties(intProperty), PropertyInfo).SetValue(objObject, Null.SetNull(CType(objProperties(intProperty), PropertyInfo)), Nothing)'. I was trying to isolate the problem (in sub Testing), but I can't figure out what's going wrong. I'm new to this stuff (that is working with a DAL, filling objects automatically) and I'm not an DotNet expert. Could someone explain to me what's going wrong? Does it have anything to do with trying to fill a wrong instance? Here's my code:
Imports DB
Imports DB.Data
Imports Microsoft.VisualBasic
Imports System
Imports System.Collections
Imports System.Collections.Specialized
Imports System.Configuration
Imports System.Data
Imports System.Data.OleDb
Imports System.Reflection
Imports System.Web
Imports System.Web.Mail
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Web.UI.HtmlControls
Imports System.Xml
Namespace Message
Public Class Contact : Inherits Page
Public lblStatus As Label
Public dg1 As DataGrid
Public Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
Dim msg As New MessageController
Dim messageid As Integer = 52
dg1.DataSource = DataProvider.Instance.GetMessage(messageid)
dg1.DataBind
Dim m As MessageInfo = CType(FillObject2(DataProvider.Instance().GetMessage(messageID), GetType(MessageInfo)), MessageInfo)
'lblStatus.Text = "test" & m.Content
' Testing(GetType(MessageInfo))
End Sub
Public Sub Testing(ByVal objType As Type)
Dim objObject As Object = Activator.CreateInstance(objType)
Dim intProperty As Integer = 4
Dim objProperties As ArrayList = GetPropertyInfo2(objType)
Dim bla As System.String = "bla"
Dim pType As Type = CType(objProperties(intProperty), PropertyInfo).PropertyType
'Mypropertyinfo.SetValue(objObject, bla, Nothing)
'CType(objProperties(intProperty), PropertyInfo).SetValue(objObject, Convert.ChangeType("hallo", pType), Nothing)
Dim MypropertyInfo As PropertyInfo = CType(objProperties(intProperty), PropertyInfo)
Response.Write(" GetValue: " & MypropertyInfo.GetValue(objObject, Nothing).ToString())
' Mypropertyinfo.SetValue(objObject, "This caption has been changed.", Nothing)
' Response.Write(" GetValue: " & Mypropertyinfo.GetValue(Myproperty, Nothing).ToString())
Response.Write(MypropertyInfo.ToString)
End Sub
Public Sub PrintValues(myList As IEnumerable)
Dim myEnumerator As System.Collections.IEnumerator = myList.GetEnumerator()
While myEnumerator.MoveNext()
Response.Write(myEnumerator.Current.ToString & " ")
End While
End Sub
Public Function FillObject2(ByVal dr As IDataReader, ByVal objType As Type) As Object
Dim objFillObject As Object
Dim intProperty As Integer
' get properties for type
Dim objProperties As ArrayList = GetPropertyInfo2(objType)
' get ordinal positions in datareader
Dim arrOrdinals As Integer() = GetOrdinals2(objProperties, dr)
PrintValues(objProperties)
For i As Integer = 0 To arrOrdinals.GetUpperBound(0)
Response.Write(arrOrdinals(i) & " ")
Next
' read datareader
If dr.Read Then
' fill business object
objFillObject = CreateObject2(objType, dr, objProperties, arrOrdinals)
Else
objFillObject = Nothing
End If
' close datareader
If Not dr Is Nothing Then
dr.Close()
End If
Return objFillObject
End Function
Public Function GetPropertyInfo2(ByVal objType As Type) As ArrayList
' Use the cache because the reflection used later is expensive
Dim objProperties As ArrayList = CType(DataCache.GetCache(objType.FullName), ArrayList)
If objProperties Is Nothing Then
objProperties = New ArrayList
Dim objProperty As PropertyInfo
For Each objProperty In objType.GetProperties()
objProperties.Add(objProperty)
Next
DataCache.SetCache(objType.FullName, objProperties)
End If
Return objProperties
End Function
Private Function GetOrdinals2(ByVal objProperties As ArrayList, ByVal dr As IDataReader) As Integer()
Dim arrOrdinals(objProperties.Count) As Integer
Dim intProperty As Integer
If Not dr Is Nothing Then
For intProperty = 0 To objProperties.Count - 1
arrOrdinals(intProperty) = -1
Try
arrOrdinals(intProperty) = dr.GetOrdinal(CType(objProperties(intProperty), PropertyInfo).Name)
Catch
' property does not exist in datareader
End Try
Next intProperty
End If
Return arrOrdinals
End Function
Private Function CreateObject2(ByVal objType As Type, ByVal dr As IDataReader, ByVal objProperties As ArrayList, ByVal arrOrdinals As Integer()) As Object
Dim objObject As Object = Activator.CreateInstance(objType)
Dim intProperty As Integer
' fill object with values from datareader
For intProperty = 0 To objProperties.Count - 1
If CType(objProperties(intProperty), PropertyInfo).CanWrite Then
If arrOrdinals(intProperty) <> -1 Then
If IsDBNull(dr.GetValue(arrOrdinals(intProperty))) Then
' translate Null value
CType(objProperties(intProperty), PropertyInfo).SetValue(objObject, Null.SetNull(CType(objProperties(intProperty), PropertyInfo)), Nothing)
Else
Try
' try implicit conversion first
CType(objProperties(intProperty), PropertyInfo).SetValue(objObject, dr.GetValue(arrOrdinals(intProperty)), Nothing)
Catch ' data types do not match
Try
Dim pType As Type = CType(objProperties(intProperty), PropertyInfo).PropertyType
'need to handle enumeration conversions differently than other base types
If pType.BaseType.Equals(GetType(System.Enum)) Then
CType(objProperties(intProperty), PropertyInfo).SetValue(objObject, System.Enum.ToObject(pType, dr.GetValue(arrOrdinals(intProperty))), Nothing)
Else
' try explicit conversion
CType(objProperties(intProperty), PropertyInfo).SetValue(objObject, Convert.ChangeType(dr.GetValue(arrOrdinals(intProperty)), pType), Nothing)
' Response.Write(pType.ToString & " " & objObject.ToString)
' Response.Write(" " & Convert.ChangeType(dr.GetValue(arrOrdinals(intProperty)), pType).ToString & "")
End If
Catch
' error assigning a datareader value to a property
CType(objProperties(intProperty), PropertyInfo).SetValue(objObject, Null.SetNull(CType(objProperties(intProperty), PropertyInfo)), Nothing)
End Try
End Try
End If
Else ' property does not exist in datareader
CType(objProperties(intProperty), PropertyInfo).SetValue(objObject, Null.SetNull(CType(objProperties(intProperty), PropertyInfo)), Nothing)
End If
End If
Next intProperty
Return objObject
End Function
End Class 'Contact
Public Class MessageInfo
'local property declarations
Private _ID As Integer
Private _UserID As Integer
Private _CreatedDate As Date
Private _Category As String
Private _Subject As String = "test"
Private _Content As String
'initialization
Public Sub New()
End Sub
'public properties
Public Property ID() As Integer
Get
Return _ID
End Get
Set(ByVal Value As Integer)
_ID = Value
End Set
End Property
Public Property UserID() As Integer
Get
Return _UserID
End Get
Set(ByVal Value As Integer)
_UserID = Value
End Set
End Property
Public Property CreatedDate() As Date
Get
Return _CreatedDate
End Get
Set(ByVal Value As Date)
_CreatedDate = Value
End Set
End Property
Public Property Category() As String
Get
Return _Category
End Get
Set(ByVal Value As String)
_Category = Value
End Set
End Property
Public Property Subject() As String
Get
Return _Subject
End Get
Set(ByVal Value As String)
_Subject = Value
End Set
End Property
Public Property Content() As String
Get
Return _Content
End Get
Set(ByVal Value As String)
_Content = Value
End Set
End Property
End Class 'MessageInfo
Public Class MessageController
Public Function GetMessage(ByVal messageID As Integer ) As MessageInfo
Return CType(CBO.FillObject(DataProvider.Instance().GetMessage(messageID), GetType(MessageInfo)), MessageInfo)
End Function
End Class 'MessageController
End Namespace
|
|
|
|
|
My VB6 program can't find referenced dll unless it located under windows directory.
What should I do in order that my VB app will search for referenced dll in local directory first?
|
|
|
|
|
Can you post the way you use the dlls?
Because when referencing a dll, OS first looks in the SAME directory that your application is running, then looks in the system folders.
|
|
|
|
|
I'm using the dll by point on its *.tlb file location via the "reference" dialog box (I have created the dll with *.odl and *.def files).
|
|
|
|
|
Hey,
I am developing a VB.NET application and am required to write a help guide to go with it.
I am using Microsofts HTML Help Workshop which is proving a vague program to use.
Is there any suggestions that you have for creating a help file and incorporating it into the applciation?
How do you create help files? What software do you use?
Thanks for your help
Chris
|
|
|
|
|
I agree Chris,
MS HTML Help is a pain to use. I've switched to RoboHelp (www.robohelp.com[^]), haven't looked back since. It's NOT free tho
Hope this helps
Rommel the iCeMAn,
Computer Programmer,
Barbados, West Indies.
|
|
|
|
|
Hello there,
I am trying to get the thumbnail preview of a file to display in an image control when you click on a file, like you see in Explorer. I know not all files support this, and that's ok.
After doing some googleing I found that IExtractImage is the way to go, but I can't find any vb.net code. It's all in c++ or vb6, and when I try to convert the vb6 code, I get a lot of errors/warnings that I can't seem to fix.
If anyone has any ideas of how to go about this, it would be greatly apreciated.
Thank you.
using:
XP
VS 2003
Will
|
|
|
|
|
How can I open the PrintDialog in a WEB form?
I have a crystalreport that I want to send directly(not to pdf, etc.) to a printer on the clients local machine. I've found a way to display available printers(System.Drawing.Printing.PrinterSettings.InstalledPrinters), but it only displays printers on the server, not local.
Thank you for any help!
|
|
|
|
|
First, your question belongs in the ASP.NET Forum.
Second, you can't do it using ASP.NET. ASP.NET only generates HTML that the browser can display. It has absolutely no control over the client. You'll have to come up with a JavaScript solution that the client can run itself.
No, don't ask me for an example because I don't have one.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I have a function in a VC Dll that has arguments which are LPCTSTR.
I am trying to call the function in VB, but I'm having problems.
I declared the function in VB as follows:
Private Declare Function function_name Lib "dll_name" _
(ByVal arg1 As String, ByVal arg2 As String) _
As Boolean
Both arg1 and arg2 are LPCTSTR.
Does anyone know how to use a DLL function that has LPCTSTR arguments?
Thanks.
|
|
|
|
|