|
Hi all,
I want to add NumericUpDown control corresponding to a property using property grid.If anybody knows it please let me know ASAP.
Regards
Ranjeet
Ranjeet Ranjan Kumar
|
|
|
|
|
Hi all,
I would like to pop-up the custom form using property grid corresponding to a property defined.If anybody knows please convery me asap.
Best Regards
Ranjeet
Ranjeet Ranjan Kumar
|
|
|
|
|
I am using visual basic 5 and I am using a crystal report object on the form. I am using the following code to bring up a template with the report which then has a button to print it.
svrId = .LogOnServer("p2sodbc.dll", "SystemDSMName", DbPath, "admin", "")
.WindowTitle = reportType
.ReportFileName = PROGRAM_PATH + "\reports\" + rptName
.PrintReport
.LogOffServer svrId, False
Everything works fine most of the time but on some client machines, when the ".PrintReport" line is reached when printing the report instead of a template coming up with the report that is displayed and can then be printed, no template or a ghost template comes up and the hour glass stays up for a while and then disappears. Its as though the system is making an attempt to bring up the template with the report, but is unsuccessful. No error message is displayed. Any other file prints fine on these machines and printer setup seems to be fine. The problem also seems to be intermittent on these machines as sometimes it works. Any help would be greatly appreciated!!![Confused | :confused:](https://codeproject.freetls.fastly.net/script/Forums/Images/smiley_confused.gif)
|
|
|
|
|
I have a problem with Combo Boxes that I just can't fathom.
I'm creating a database front end working in VB.net. The front end requires loads if lists such as UK Counties, Suppliers etc. To handle these I've created Class Objects to hold an ID as an Integer and a KnownAs name string . These Objects are stored in an ArrayList inside a second Class which provides methods to supply the appropriate data when asked - I've split the data descriptive Class from the data handling Class as I eventually will use remoting and will pass an ArrayList of my data Objects to my data handling Object. These lists are shared and either static as in the case of Counties or have a Time To Refresh as in the case of Suppliers and exist for the life of the Application. The records, say Customer details are stored in their own Classes with the County value being stored as an ID. The values are written to the Form fields manually - I've not used binding. In the case of the Combo Box I set the DataSource to my data handling Class, the DisplayMember to my KnownAs string and the ValueMember to my ID (both values are Methods in my Class). On applying my record to the Form I set the Combo Box SelectedValue to the appropriate record ID value.
Here's my problem - If my lists are sorted by ID it all works as expected. If, however, I set the Combo Box to sort the DisplayMember it all goes pear shaped. I realise that a Combo Box stores the ValueMember as a string and sorting the DisplayMember scrambles the ValueMember order, but I find it hard to believe that something I've been doing in Access for years doesn't work here. Apart from these niggling problems I'm very much in favour of DotNet. Any ideas ?
Steve
Answered my own problem:
Sort the data within the query and turn ComboBox sorting off.
The ArrayList is zero based as is the ComboBox list so provide a GetIndex procedure that searches the ArrayList for the required ID and returns the corresponding Index (Incremented Count from zero).
PS ValueMember is an Object and not a String as I've previously stated.
|
|
|
|
|
Hi!
I'm trying to find a way of, by code, to register a file type (Ex .vmn) and to assign an icon to that extention, i would also like to know how to make that file type only openable by a pre-defined program!
Thank you for your time
|
|
|
|
|
I have a picturebox control i want to save the image of the picturebox into sqlserver database ,how is it possible using insert query in VB.NET.please help me with code
|
|
|
|
|
you can just store the image path in the database and then use the load picture function and use the path stored in the database if you dont know these functions i know i have the code somewhere i would have to find my .net version but i know exactly where my vb6 version is so let me know if you need further help
|
|
|
|
|
|
Thanx a lot Thats what i was needed
|
|
|
|
|
How can i use a dll in VC++ which is written in VB???
please help me as soon as possible.
thanks
sukhdeep
|
|
|
|
|
Yes..
If you make a VB project ActiveX DLL and create Class modules you can cerate objects of these classes in VC++
but VB can't expose functions that can be called using Declare in vb6 or ::LoadLibrary in VC++
|
|
|
|
|
Hi,
How can I print pdf files from a batch file without user interaction and to any specific printer. Its important the printer selection.
Regards
Pedro
|
|
|
|
|
|
i am in the process of writing a game called bunco and i have hit one of those walls. Basically i have an 12 element array and at the end of the game i need to find out which element holds the highest value,which holds the second highest, and what holds the third highest but i also need to find out if there is a tie for any of those spots now i know the long way to do this but was hoping that someone might know a shorter and more effiecient way
|
|
|
|
|
If in VB.NET, use Array.Sort.
If in VB6, search the web for a sort routine.
It's not the fall that kills you: it's the sudden stop - Down by Law, Jim Jamursch (1986)
|
|
|
|
|
thats not exactly what im looking for. it is vb6 and the reason i came here was to find some help normally i would just use this one sort function but the problem is the elements in the array are all instances of the player class so not only do i need to find out the 1st 2nd and 3rd place winners but i need to know the names of them which makes it a little more noodle scratching than a normal array and the thing that sucks most is i can see the solution on the back of my brain well anyways if anyone has any ideas
|
|
|
|
|
Hi,
I am trying to convert the below code to a vb.net project.
I have tried all sorts but didnt manage to do it.
can anybody help?
http://www.codeproject.com/csharp/servercombobox.asp?target=servercombobox
Thanks A lot
Gabriel
vbnetuk@yahoo.co.uk
|
|
|
|
|
What are you trying to do? The whole control or just the Server enumeration?
|
|
|
|
|
I managed to convert the server enumeration no problem it's driving me mad and would seriously appreaciate somebody's help.
There is only one class "Network Management" and it's not that
big but non knowing c# that well it's proving a nightmare.
I only need to convert that class.
Thanks A lot
Gabriel
vbnetuk@yahoo.co.uk
|
|
|
|
|
Well, I am not going to go in depth, converting this stuff takes a lot of time and patience. However, if you want help on a specific piece, post it here.
|
|
|
|
|
I totally understand that .Thanks
There are 2 piecies of code that creates problem for me
1)
public bool MoveNext()
{
bool result = false;
if ( ++currentItem < itemCount )
{
int newOffset = serverInfoPtr.ToInt32() + SERVER_INFO_101_SIZE * currentItem;
Win32API.SERVER_INFO_101 si = (Win32API.SERVER_INFO_101) Marshal.PtrToStructure(new IntPtr(newOffset), typeof(Win32API.SERVER_INFO_101));
currentServerName = Marshal.PtrToStringAuto(si.lpszServerName);
result = true;
}
return result;
}
=====================
2)public static ServerType GetServerType(string serverName)
{
ServerType result = ServerType.None;
IntPtr serverInfoPtr = IntPtr.Zero;
uint rc = Win32API.NetServerGetInfo( serverName, 101, ref serverInfoPtr );
if ( rc != 0 )
{
Win32API.SERVER_INFO_101 si = (Win32API.SERVER_INFO_101) Marshal.PtrToStructure(serverInfoPtr, typeof(Win32API.SERVER_INFO_101));
result = (ServerType) si.dwType;
Win32API.NetApiBufferFree(serverInfoPtr);
serverInfoPtr = IntPtr.Zero;
}
return result;
}
Thanks A lot
Gabriel
vbnetuk@yahoo.co.uk
|
|
|
|
|
Ok, let me attempt this blindly since I do not have all the code LOL! Lets start with the First one. I may rename variables but you'll get the idea.
The number one thing in dealing with API Calls is this:
Imports System.Runtime.InteropServices 'Put in Header
'=====================
'1.)
Public Function MoveNext() As Boolean
Dim svrInfo As Win32API.SERVER_INFO_101
Dim bResult as Boolean = False 'Unnecessary because Boolean = False by default
CurrentItem += 1 'Increment the CurrentItem Counter
If (CurrentItem < ItemCount) Then
Dim iOffset As Integer = (svrInfoPtr.ToInt32 + SERVER_INFO_101_SIZE * CurrentItem)
Marshal.PtrToStructure(New IntPtr(iOffset), GetType(svrInfo))
CurrentServerName = Marshal.PtrToStringAuto(svrInfo.lpszServerName)
bResult = True
End If
Return bResult
End Function
'=====================
Lets make it a little better by using some Error Trapping. Try this next example:
'=====================
'1.)
Public Function MoveNext() As Boolean
Dim svrInfo As Win32API.SERVER_INFO_101
Dim bSuccess As Boolean
CurrentItem += 1 'Increment the CurrentItem Counter
If (CurrentItem >= ItemCount) Then Return False 'Exit if the Item is outside the Memory Address Range
Try
Dim iOffset As Integer = (svrInfoPtr.ToInt32 + SERVER_INFO_101_SIZE * CurrentItem)
Marshal.PtrToStructure(New IntPtr(iOffset), GetType(svrInfo))
CurrentServerName = Marshal.PtrToStringAuto(svrInfo.lpszServerName)
bSuccess = True
Catch
'Display Error Message if you want
bSuccess = False
End Try
Return bSuccess
End Function
'=====================
To be continued...
Not all those who are lost are looking to be found. But of those who are lost and those who are found, all are looking for something higher than themselves.
|
|
|
|
|
...Continuation:
'=====================
'2)
Public Function GetServerType(ByVal ServerName As String) As ServerTypes
Dim svrInfoPtr As IntPtr = IntPtr.Zero
Dim svrInfo As Win32.SERVER_INFO_101
Dim hResult As Integer = Win32API.NetServerGetInfo(ServerName, 101, svrInfoPtr) 'Make sure the API Declarations have the Appropriate Byval / Byref
If (hResult <> 0) Then
'Marshal.PtrToStructure(svrInfoPtr, GetType(svrInfo))
Marshal.PtrToStructure(svrInfoPtr, svrInfo)
Return Ctype(svrInfo.dwType, ServerTypes)
Else
Return ServerTypes.None
End If
End Function
I am sorry if there is anything wrong with these Posts...again, I did this all by looking at it and I did not "Pre-Code" this to see if it works.
Good luck!
Not all those who are lost are looking to be found. But of those who are lost and those who are found, all are looking for something higher than themselves.
|
|
|
|
|
I am using VB.Net..
I have been trying this for awhile...
Im making a simple console app that is a database for different video games.
It will store the name, genre and a rating out of 10..
But I want it set up as several sub procedures to clean up my code.
Also because I hoped it would look like an old DOS menu based system...
Something like this:
Games Database
--------------
1) Add a game
2) Display a games info
3) Display rating average
4) Display rating summary
5) Delete a game
6) Quit
Enter a choice:_
______________________________________________
"I'm not me when I dream...anymore." -TRUSTcompany
|
|
|
|
|
This is what i have so far..and i'm getting an error...
Module Exercise4
Private Structure Game
Dim name, genre As String
Dim rating As Single
End Structure
Sub Main()
Dim gameArray() As Game
Dim choice, count As Integer
Dim name, genre As String
Dim rating As Single
Call DisplayMainMenu()
choice = CInt(Console.ReadLine())
If choice = 1 Then
Console.Write("Enter the name of the game: ")
gameArray(0).name = CStr(Console.ReadLine())
End If
Console.ReadLine()
End Sub
Private Sub DisplayMainMenu()
Console.WriteLine(" Game Database" & vbCrLf & " -------------")
Console.WriteLine(vbCrLf & "1) Add a Game" & vbCrLf & "2) Display a Game")
Console.WriteLine("3) Display Rating Average" & vbCrLf & "4) Display Rating Summary")
Console.WriteLine("5) Quit" & vbCrLf)
Console.Write("Enter a choice: ")
End Sub
End Module
______________________________________________
"I'm not me when I dream...anymore." -TRUSTcompany
|
|
|
|