|
Thanks,
I have Designed my project
I have two panel on my project. Left panel contain manu like add newMember, newBook, borrowBook, returnBook etc. When I will click any option then Right Panel will fill that information like newMemberRegister form, borrowBook form.
like function newMember()
when I will call this function then Right Panel will fill frmNewMember
any idea?
Thanks
Sarfaraj
Sarfarj Ahmed
|
|
|
|
|
You don't need an MDI form to do this. Among newbies, MDI is probably the second most abused idea, next to using a PictureBox to draw everything.
Make up your forms as normal. When you need to create a form and show it in the panel, you do something like this:
Dim currentForm As New BorrowBookForm()
currentForm.TopLevel = False
RightSidePanel.Controls.Add(currentForm)
You'll have to manage keeping only one form in that panel and destroying the previous form before putting the new one in the Panel. This is because if you don't, you'll run the system out of resources due to exhaustion of the handle pool.
|
|
|
|
|
Dear Dave
what I done is , I have add two form on the project form1 and form2
form on:
I have taken two panel panel1 and panel2
On panel1 i have add a button and panel2 is empty. On button click event i wrote code you given
Dim currentForm As New form2()
currentForm.TopLevel = False
panel2.Controls.Add(currentForm)
But can't see the form2 on panel2. waiting for your reply
Sarfarj Ahmed
|
|
|
|
|
So much for the ability to do research...
currentForm.Show()
|
|
|
|
|
Dave
Thanks a lot. it does work. Dave I got question, Im doing a Library Mangement Project and it has to be desktop and internet based. Basically Member can login on internet, they can view their report. But in the library it has to be really fast. Also I have to maintain same server for desktop and internet. library will get Intranet connection and member will get internet connection.
wot your suggestion
waiting for your reply
Sarfarj Ahmed
|
|
|
|
|
Sarfaraj Ahmed wrote: wot your suggestion
Suggestion for what??
|
|
|
|
|
Thanks For Replying ,
Hi , now i am using my own custom propertygrid for runtime controls when i am clicking on textbox it is showing properties . I am showing font,backcolor,location ,like some properties
1) How to create the wordwrap,TextAlign properties .
2) Now the problem arises with borderstyle ,Multiline and some other Properties while selecting textbox, I am not able to set these properties .These are not there by default for runtime ctr.I created the properties for borderstyle,. I dont know how to create the property for TextAlign . NOt Coming with (System.Win.Forms.TextboxBase)
.Dim ctr as control --- TRhen i am getting properties butnot borderstyle,textalign ,etc
3) In PropertyGrid1_PropertyValueChanged , i am writing like this
Case "Font"<br />
ctr.Font = e.ChangedItem.Value<br />
Select Case e.ChangedItem.Label<br />
<br />
Case "BackColor"<br />
ctr.BackColor = e.ChangedItem.Value<br />
<br />
Case "BorderStyle"<br />
if ctype(sender,TextBox) then '''Borderstyle not coming <br />
ctr.BorderStyle( Not Coming) = e.ChangedItem.Value <br />
<br />
Dim ctr As New TextBox ''If i use like this only borderstyle is coming "<br />
ctr.BorderStyle( Coming) = e.ChangedItem.Value ' but Not working
waiting For Reply ......
DVSriram
|
|
|
|
|
Hi,
I am not sure about your problem. If I create a form with a textbox and a PropertyGrid, all the textbox properties that you mentioned are in the grid. I see no issue.
Also what do you mean by "custom PropertyGrid" ?
|
|
|
|
|
I am using the following code to send mail but it fails with message below
System.Web.HttpException: Could not access 'CDO.Message' object. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Runtime.InteropServices.COMException (0x80040213): The transport failed to connect to the server.
/////////////////////////////// Code //////////////////////////////////////////////////////////
Imports System.Web.Mail
Public Class Form1
Inherits System.Windows.Forms.Form
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim oMsg As MailMessage = New MailMessage
oMsg.From = "from@gmail.com"
oMsg.To = "to@alumnux.com"
oMsg.Subject = "Test Mail from soumya"
oMsg.BodyFormat = MailFormat.Html
oMsg.Body = "Hellow World "
SmtpMail.SmtpServer = "smtp.gmail.com"
oMsg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserver", "smtp.gmail.com")
oMsg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport", "587")
oMsg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusing", 2)
oMsg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpusessl", "true") 'set your password here
oMsg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1") 'basic authentication
oMsg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "user@gmail.com") 'set your username here
oMsg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "password") 'set your password here
SmtpMail.Send(oMsg)
oMsg = Nothing
End Sub
End Class
|
|
|
|
|
|
Thanks a lot for your reply.I have read this tutorial and i am sure this will work work successfully but one problem is this tutorial is developed in .NET Framework 3.0 so how can do the list below:
1. Currently 1.1 is installed
2. I have downloaded 3.0 and installed it.
3. How can i switch to 3.0 without uninstalling 1.1
4. I am using visual studio 7.0
|
|
|
|
|
How can i get back column data from the dataset which i created.
The problem is that i have a table in the table second column i have some data but the table is in the dataset pl z tell me the technique how can i get it back.
|
|
|
|
|
A DataSet has a Tables collection. A Table has a Columns collection.
Use these to get the information you need.
Paul Marfleet
|
|
|
|
|
Can any one help me to make a Attendance register that will record all Attandance of employees of my company. and on that basis i will generate the payroll. I have already tried a solution that will create Monthly Tables in Access example
Table name will be : EMPLOYEENAME/MONTH (ABC/FEB-07)
but this will be a lot space consuming. i want to try a diffrent solutions sample projects will be appreciated Please Help Guys.
Hefin Dsouza
|
|
|
|
|
This is a pretty straight forward task. Which bit are you worried about ? you want to create one table for all employees, and another that tracks attendance.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
skullz_softwares wrote:
but this will be a lot space consuming.
Okay - what it looks like you need to do is normalize your data.
This way you will keep space to a minimum and also keep duplication of data to a minimum.
So as an initial suggestion why not create two tables as follows(of course you will know the fields needed):
Employee table:
Employee ID
Employee name
address1
address2
address3
address4
address5
Tel no.
etc...
Attendance Table:
Employee ID
Date
Time start
Time End
Break time
You can then join the tables on the [Employee ID] field.
This is a start and you may need to add more tables/joins etc.
Hope this helps.
You always pass failure on the way to success.
|
|
|
|
|
Hello,
VS 2005
I have a typed dataset.
I am trying to fill the typed dataset from a datset that is returned from a web service.
<br />
Me.DsOrders.customers = ws.getCustomers()<br />
However, the error message I get is: "customer table is read-only"
Is there any way you can fill a typed dataset table like this. This works fine with a untyped dataset. However, I have already done this project using typed and too late to change now.
Many thanks for an suggestions.
Steve
|
|
|
|
|
I won't claim to be really sure, but I'm fairly sure that the error would be different if you did it the wrong way.
The error message is straightforward enough: the table you are trying to populate is read only at the moment you try to copy in the data.
You could just try to set DsOrders.ReadOnly to false, before you fill it.
Hope it helps,
Johan
My advice is free, and you may get what you paid for.
|
|
|
|
|
How to inject a dll to exe process
The dll is compiled by vb (stand dll use Create in Visual Basic version 2)
Now i succeed inject it to a process ,but the code in the dll dont execute
my code in dll:
Public Declare Function MessageBox Lib "user32" Alias "MessageBoxA" (ByVal hwnd As Long, ByVal lpText As String, ByVal lpCaption As String, ByVal wType As Long) As Long
Public Declare Function GetCurrentProcessId Lib "kernel32" () As Long
Public Const DLL_PROCESS_DETACH = 0
Public Const DLL_PROCESS_ATTACH = 1
Public Const DLL_THREAD_ATTACH = 2
Public Const DLL_THREAD_DETACH = 3
Public Const MB_OK = &H0&
Public Function DllMain(hInst As Long, fdwReason As Long, lpvReserved As Long) As Boolean
Select Case fdwReason
Case DLL_PROCESS_DETACH
Case DLL_PROCESS_ATTACH
DllMain = True
MessageBox 0, CStr(GetCurrentProcessId()), "aaa", MB_OK
Case DLL_THREAD_ATTACH
Case DLL_THREAD_DETACH
End Select
End Function
|
|
|
|
|
yoya0303 wrote: How to inject a dll to exe process
yoya0303 wrote: The dll is compiled by vb (stand dll use Create in Visual Basic version 2)
Which version again?? VB2 is REALLY old! Or are you talking about VB.NET 2002, or 2003, or 2005, or 2008??
yoya0303 wrote: Now i succeed inject it to a process ,but the code in the dll dont execute
VB6 does not support creating .DLL's of the type that are required to support "DLL Injection".
Also, just because you injected the code, doesn't mean that the .EXE knows how to call it. Your code has to hook something to be executed in the .EXE that you injected it into, or it has to be called from an outside source.
|
|
|
|
|
I used VB6 with dll addin plus to compile dll file.
Yes,I called from an outside source.but it dont work.
my dll code:
Public Declare Function MessageBox Lib "user32" Alias "MessageBoxA" (ByVal hwnd As Long, ByVal lpText As String, ByVal lpCaption As String, ByVal wType As Long) As Long
Public Declare Function GetCurrentProcessId Lib "kernel32" () As Long
Public Const DLL_PROCESS_DETACH = 0
Public Const DLL_PROCESS_ATTACH = 1
Public Const DLL_THREAD_ATTACH = 2
Public Const DLL_THREAD_DETACH = 3
Public Const MB_OK = &H0&
Public Function DllMain(hInst As Long, fdwReason As Long, lpvReserved As Long) As Boolean
Select Case fdwReason
Case DLL_PROCESS_DETACH
Case DLL_PROCESS_ATTACH
DllMain = True
MessageBox 0, CStr(GetCurrentProcessId()), "aaa", MB_OK
Case DLL_THREAD_ATTACH
MessageBox 0, CStr(GetCurrentProcessId()), "aaa", MB_OK
Case DLL_THREAD_DETACH
End Select
End Function
my ouside code
Public Const PROCESS_VM_READ = &H10
Public Const TH32CS_SNAPPROCESS = &H2
Public Const MEM_COMMIT = 4096
Public Const PAGE_READWRITE = 4
Public Const PROCESS_CREATE_THREAD = (&H2)
Public Const PROCESS_VM_OPERATION = (&H8)
Public Const PROCESS_VM_WRITE = (&H20)
Public Const MB_OK = &H0&
Public Declare Function ReadProcessMemory Lib "kernel32" (ByVal hProcess As Long, ByVal lpBaseAddress As Long, ByVal lpBuffer As String, ByVal nSize As Long, lpNumberOfBytesWritten As Long) As Long
Public Declare Function GetLastError Lib "kernel32" () As Long
Public Declare Function VirtualAllocEx Lib "kernel32" (ByVal hProcess As Long, ByVal lpAddress As Long, ByVal dwSize As Long, ByVal flAllocationType As Long, ByVal flProtect As Long) As Long
Public Declare Function WriteProcessMemory Lib "kernel32" (ByVal hProcess As Long, ByVal lpBaseAddress As Long, ByVal lpBuffer As String, ByVal nSize As Long, lpNumberOfBytesWritten As Long) As Long
Public Declare Function GetProcAddress Lib "kernel32" (ByVal hModule As Long, ByVal lpProcName As String) As Long
Public Declare Function GetModuleHandle Lib "kernel32" Alias "GetModuleHandleA" (ByVal lpModuleName As String) As Long
Public Declare Function Process32First Lib "kernel32" (ByVal hSnapshot As Long, lppe As PROCESSENTRY32) As Long
Public Declare Function CreateToolhelp32Snapshot Lib "kernel32" (ByVal dwFlags As Long, ByVal th32ProcessID As Long) As Long
Public Declare Function CreateRemoteThread Lib "kernel32" (ByVal hProcess As Long, ByVal lpThreadAttributes As Long, ByVal dwStackSize As Long, ByVal lpStartAddress As Long, ByVal lpParameter As Long, ByVal dwCreationFlags As Long, lpThreadId As Long) As Long
Public Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long
Public Declare Function Process32Next Lib "kernel32" (ByVal hSapshot As Long, lppe As PROCESSENTRY32) As Long
Public Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long
Public Declare Function GetCurrentProcessId Lib "kernel32" () As Long
Public Type PROCESSENTRY32
dwSize As Long
cntUseage As Long
th32ProcessID As Long
th32DefaultHeapID As Long
th32ModuleID As Long
cntThreads As Long
th32ParentProcessID As Long
pcPriClassBase As Long
swFlags As Long
szExeFile As String * 1024
End Type
Public Function EnumAndInject(ByVal ProcessName As String, ByVal DllFileName As String) As Boolean
Dim MySnapHandle As Long
Dim ProcessInfo As PROCESSENTRY32
Dim MyRemoteProcessId As Long
Dim MyDllFileLength As Long
Dim MyDllFileBuffer As Long
Dim MyReturn As Long
Dim MyStartAddr As Long
Dim MyResult As Long
Dim temp As Long
MySnapHandle = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0)
ProcessInfo.dwSize = Len(ProcessInfo)
If Process32First(MySnapHandle, ProcessInfo) <> 0 Then
Do
Debug.Print ProcessInfo.szExeFile
If InStr(LCase(ProcessInfo.szExeFile), ProcessName) > 0 Then
MyRemoteProcessId = OpenProcess(PROCESS_CREATE_THREAD + PROCESS_VM_OPERATION + PROCESS_VM_WRITE + PROCESS_VM_READ, False, ProcessInfo.th32ProcessID)
MyDllFileLength = Len(DllFileName) + 1
MyDllFileBuffer = VirtualAllocEx(MyRemoteProcessId, 0, MyDllFileLength, MEM_COMMIT, PAGE_READWRITE)
MyReturn = WriteProcessMemory(MyRemoteProcessId, MyDllFileBuffer, DllFileName, MyDllFileLength, temp)
MyStartAddr = GetProcAddress(GetModuleHandle("Kernel32"), "LoadLibraryA")
MyResult = CreateRemoteThread(MyRemoteProcessId, 0, 0, MyStartAddr, MyDllFileBuffer, 0, temp)
End If
Loop While Process32Next(MySnapHandle, ProcessInfo) <> 0
End If
CloseHandle MySnapHandle
End Function
|
|
|
|
|
OK. I see what you're trying to do, but it's never going to work. VB 6 cannot generate the kind of DLL that is required for "DLL Injection". VB6 can only generate a COM-based DLL, which won't work for you because the required exports are not there. There is no way to "force" VB6 to generate those exports. You'd have to use some other wrapper around your DLL code to get this to work. Don't ask - I don't have any idea if someone has written one - let alone how to use whatever you find.
|
|
|
|
|
Thank you .I'll try to use C++ compile the dll.
|
|
|
|
|
For example i have a query table named (Qsupplier) consist of 3 rows and 5 columns.
EXAMPLE:
Supplier 1 2 3 4
Software Inc. 20000 90
Science Technology Co. Ltd 2000 800 500 80
Book Electronic Co. Ltd 30000 30000 24000 25
1. using the data reader how can i know if how many suppliers are there in the Qsupplier?
Thanks in advance guys.
die_nadel;)
|
|
|
|
|
Look up the COUNT statement, it's SQL to find out how many objects exist based on a query.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|