|
Although I am not sure how you would have to go about it, you could for example program your app to only use the default printer and/or devise a method to check whether a printer is virtual or real. If it is real allow printing, and if not then disallow.
My advice is free, and you may get what you paid for.
|
|
|
|
|
Hi,
I have a form application (Form1) with contol1 (a Label) as an added control of control2(a panel) I tried to process the mousedown event in control2 when mousedown happens in control1.
I tried to use code like this
Label_click(...) handles control1.mousedown
RaiseEvent control2.mousedown(...)
it wont compile.. ;(
Any idea on how to do it?
Or even better, how to make control1 transprent of any event (possible?) so that control2 will directly see the mousedown event.
Is there any good book or tutorials talk about events handling?
Thanks a lot.
|
|
|
|
|
Why don't you just call the hanlder (or even better the sub/function doing your stuff) directly instead of trying to fire the event itself?
This is the way I normaly do this:
Write functions/subs to do your stuff.
In the eventhandlers just call those functions (a benefit of this is that you can implement your events with AddHandler and a anonymous function if you like - of couse you can do this anyway but the AddHandler line / block will get very crowded if you code everything there).
|
|
|
|
|
I need to modify the sizes of other controls in the panel based on the mousemove event. I think the mousemove events only provide the client coordinates, i.e. the coordinate inside control1, if the event is handled in the label. So I need to convert the coordinate, right? or there are better ways to do it?
More specific, I am doing width-resziable labels in the panel. I try to resize the label width with mouse... just like resize the colume within a table.
Thanks
|
|
|
|
|
I needed to make a change to the size of a field in an access database so that it would store a path to an image. The field was a text field with a size of 50...I changed it to size of 255 which is the max.
So now I cannot figure out what I need to update in my program so that it will pick up the new field size change. I keep getting an error that says I am violating the maxlength limit of the column.
Any suggestions?
Thanks
Tom Wright
tawright915@gmail.com
|
|
|
|
|
Did you save the change? Have you confirmed that the access database has the new size?
When you change the data structure, the code will automatically pick up the change, as long as you rerun the program and the connection is recreated.
Also, I would check the length of the path, which you are trying to save in the database.
VB Prog
|
|
|
|
|
In my VB.net application I want to make sure that only one instance of application is running at a time on a client computer. Furthermore I want to perform following tasks:
1. My application should accept a command line argument (Customer Id).
2. Pass this argument to already running instance of the application.
3. Search and load customer data from database and display the respected form in the existing instance.
I have managed to restrict multiple instance by using Process object and easily accepted command line arguments by using My.Application.CommandLineArgs collection.
Public Sub Main()
Dim tempProcess As Process
tempProcess = checkInstance() ' A function which validates current process
If tempProcess Is Nothing Then
Application.Run(New frmWelcome)
Else
Dim hwnd As Int32
hwnd = tempProcess.MainWindowHandle.ToInt32
Try
If hwnd > 0 Then
If IsWindowVisible(hwnd) = False Then
ShowWindowAsync(hwnd, ShowWindowConstants.SW_MAXIMIZE)
End If
SwitchToThisWindow(hwnd, True)
SetForegroundWindow(hwnd)
SetActiveWindow(hwnd)
LoadContact() 'A function which extracts command line argument and call a function from existing running instance.
Application.Exit()
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
End If
End Sub
When I call a function from existing instance I get an error 'Unable to create window handle'.
Basically I am not an experienced VB.Net programmer, I will appreciate if someone have a look into it and help me out. I will be very thankful if someone pass me an example.
Many thanks
Nas
|
|
|
|
|
how i can make tow programs client and server,that i can connected with the server from more than one client.
Thanks'.
|
|
|
|
|
Probably through using the System.Net namespace. You might want to try googling since there are plenty of examples out there and even on this site...
"I guess it's what separates the professionals from the drag and drop, girly wirly, namby pamby, wishy washy, can't code for crap types." - Pete O'Hanlon
|
|
|
|
|
hi,
i need to create a bill(print out) with the details entered in the textbox of a form.
i need to place those details in the appropriate place in the bill(with some co-ordinates like(x,y)in a4 sheet(for eg)).i donno even how to start.anybody please help me to get a printout.
Thanks in advance,
M.Saravana...
|
|
|
|
|
saravana001 wrote: donno even how to start
Maybe you could start with a reporting engine like Crystal Reports, or some of the other good ones out there. I leave it to you as a research exercise to google the other good ones
"I guess it's what separates the professionals from the drag and drop, girly wirly, namby pamby, wishy washy, can't code for crap types." - Pete O'Hanlon
|
|
|
|
|
The Visual Basic Power Toys gave you a very simple printing method (like VB6).
And also search google with "printing vb.net" -> you will found enough to start.
|
|
|
|
|
Hi All,
I have done a project in VB6. The main EXE file and supporting files copied to USB drive. I want to give Copy protection for the USB.
I need to protect my application against illegal copying.
Please give some suggestion. Thanks
Thanks & Regards
Kumaran
|
|
|
|
|
Kumaran21cen wrote: I want to give Copy protection for the USB.
I need to protect my application against illegal copying.
Please give some suggestion.
Sure...good luck since copy protecting an app is a long and involved process that is out of the scope of a forum posting.
"I guess it's what separates the professionals from the drag and drop, girly wirly, namby pamby, wishy washy, can't code for crap types." - Pete O'Hanlon
|
|
|
|
|
We sell a licensing library, but it only handles licensing and no further - copy protection is a long, involved, frustrating and eventually futile ball game (kindof like golf).
Hit up google for copy-protection libraries. Theres a few licensing libraries around that have copy-protection features - but I can't speak for their effectiveness.
|
|
|
|
|
VB.NET 2005
I have some toolbar buttons on my "main" form that i would like to access from another form
Somehow, I have not been able to figure it out ...
Inside the Main window I can use
DriveEnable.pushed =true (where DriveEnable is the name of the actual button in the collection) and that works (of course )
In my module I'm using
Main.Drivenable.pushed =true .. but it does not work (no error either - just nothing happens)
I have set all "possible" properties of the toolbar tool / button(s) to Public - doesnt seem to help me ..
Whats the missing link ?
|
|
|
|
|
Assume Main is a form and not another module/class/object
Are you passing an instance of "Main" to your module.
EG calling the function in your module from the main form
dim oModule as new Module
oModule.CallFunction(me)
Public sub CallFunction(oFrm as Form)
oFrm.Drivenabled=true
end Sub
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi All,
I am using a datagrid in a ASP.NET page.
The data grid is inside a div tag.
<div id="divEditProjectRes" style="OVERFLOW: auto; HEIGHT: 150px">
<asp:datagrid id="dgEditResource" runat="server" Width="100%">
There is edit option in each row of the data grid and the user can edit on a few fields.
The grid has many records and the user has to scroll down.After scrolling to the record and clicking on edit there is a post back ,and the grid is set back to the top and he again has to scroll back to the row in which now fields are editable.
What I want here is that after he clicks on edit the same row must come at the top and the user need not scroll it again.
I have used the following code in dgEditResource_EditCommand to set focus to the editable text box in the particular scroll row ,Although it gets the focus but again we need to scroll down .
Dim descTB As TextBox
descTB = dgEditResource.Items(e.Item.ItemIndex).Cells(2).FindControl("sdate_edit")
'Set the script to focus and select the TextBox
RegisterStartupScript("focus", "<script language=""JavaScript"">
vbTab & "Form2." & descTB.ClientID & ".focus();"
vbCrLf & vbTab & "Form2." & descTB.ClientID & ".select();" & "<" & "/script>")
descTB = dgEditResource.Items(e.Item.ItemIndex).Cells(2).FindControl("percent_Edit")
If we press tab or space bar the record comes up as focus is already in the text box.
But I need that row to scroll up or navigate by itself after edit is clicked.
Thanks in advance.
Regards,
Sakshi
|
|
|
|
|
Please use the pre and code tags to make your code snippet more readable
nolnaH'O eteP - ".sepyt parc rof edoc t'nac ,yhsaw ,ybmap ybman ,ylriw ylrig ,pord dna gard eht morf slanoisseforp eht setarapes tahw s'ti sseug I"
|
|
|
|
|
Hi,
I want to print organizational chart in Crystal or any .Net 2005 solution.
e.g. Top Country Managers
City Managers
Area Managers
Sales officers
like a Hierarchy table.
Nasir Mahmood
|
|
|
|
|
Have you looked at any CR tutorials? This is pretty straightforward.
nolnaH'O eteP - ".sepyt parc rof edoc t'nac ,yhsaw ,ybmap ybman ,ylriw ylrig ,pord dna gard eht morf slanoisseforp eht setarapes tahw s'ti sseug I"
|
|
|
|
|
hi ,
i want to dial a phone number using windows default dialer.Can anybody have idea that, how can i perform this thing using vb.net ?
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
My Company
|
|
|
|
|
have you tried googling?
"I guess it's what separates the professionals from the drag and drop, girly wirly, namby pamby, wishy washy, can't code for crap types." - Pete O'Hanlon
|
|
|
|
|
I am using
OS = Windows XP
Visual Basic Enterprise Edition 6
I have a problem in Printing in pre printed bill .
Bill Size
Height : 6 inches Width of paper : 9.1 inches
I wish to print bill by bill, Pre printed stationery is continious paper, I wish to print in one bill after one bill the paper automatically skip to other bill.
the problem is : while printing the paper moves for A4/Letter and i cann't able to enable the Tear off Mode.
Please go through the below three codes and help me fix paper size
==================================================================================
I used three codes to print . But problem contious. There is no paper size in VB for my paper setting ( height 6 inches , width 9.1 inches)
I used three methods to print one is
--------------------------------------------------------
Printer.ScaleMode = ScaleModeConstants.vbTwips
Printer.Width = 13104
Printer.Height = 8640
.............................
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Printer.EndDoc
Printer.NewPage
End Function
the above method while printing the paper moves for A4/Letter and i cann't able to enable the Tear off Mode.
How can i set paper size of Height : 6 inches Width of paper : 9.1 inches
====================================================
2. Second code creating Text file and printing by creating text files one of my friend suggestes
=======================================================
Call modBillPrinter.OpenPrintFile
Call modBillPrinter.PrintPLine(Chr(12))
Call modBillPrinter.PrintPLine(Space(10) + MakeString(Trim(cname), 15, ALIGN_LEFT) + Space(5) + MakeString(Trim(bno), 10, ALIGN_LEFT))
Call modBillPrinter.PrintPLine(Space(10) + MakeString(Trim(place), 15, ALIGN_LEFT) + Space(5) + MakeString(bdate, 10, ALIGN_RIGHT))
Call modBillPrinter.PrintPLine(Chr(12))
Call modBillPrinter.PrintPLine(Space(5) + MakeString(" S.NO", 5, ALIGN_LEFT) + Space(3) + MakeString("Particulars", 20, ALIGN_LEFT) + Space(3) + MakeString("Grms", 6, ALIGN_RIGHT) + Space(3) + MakeString("Wastage", 7, ALIGN_RIGHT) + Space(3) + MakeString("Rate", 4, ALIGN_RIGHT) + Space(3) + MakeString("MC", 5, ALIGN_RIGHT) + Space(3) + MakeString("SC", 5, ALIGN_RIGHT) + Space(3) + MakeString("Amount", 10, ALIGN_RIGHT))
Call modBillPrinter.PrintPLine(Chr(12))
Print #1, Spc(8 - Len(CStr(psno))); psno; Spc(3); '8
Print #1, particulars; Spc(20 - Len(CStr(particulars))); '17
Print #1, Spc(9 - Len(CStr(grams))); grams; '7
Print #1, Spc(8 - Len(CStr(wastage))); wastage;
Print #1, Spc(11 - Len(CStr(trate))); trate; '7
Print #1, Spc(9 - Len(CStr(mc))); mc; '7
Print #1, Spc(8 - Len(CStr(sc))); sc; '7
Print #1, Spc(12 - Len(CStr(amount))); amount '11
Print #1, vbCr
Print #1, Spc(76 - Len(CStr(Netamttxt.Text))); Netamttxt.Text
Print #1, Chr(12)
modBillPrinter.ClosePrintReport
Shell App.Path & "\PRINT.BAT", vbHide
End Function
Here the problem is i cannot change font size ,
And i wish the usage of follwing for what following command used
1. Print #1, vbCr ?
2. Print #1, Chr(12)
3. Print #1, Spc(12
4. Print #1, vbCrLf
====================================================================
3 Third method - ( In this method no printing no out put in printer totally no print out
=====================================================================
Open "E:\jewelproject\DSREPO.TXT" For Output As #1
Call Header
psno = 1
While psno <= sno
If tcount > 5 Then
Print #1, Chr(12)
Call Header
tcount = 1
End If
mg1.Row = psno
mg1.Col = 2: particulars = mg1.Text
mg1.Col = 3: grams = mg1.Text
mg1.Col = 5: wastage = mg1.Text
mg1.Col = 6: trate = mg1.Text
mg1.Col = 7: mc = mg1.Text
mg1.Col = 8: sc = mg1.Text
mg1.Col = 9: amount = mg1.Text
Print #1, Spc(8 - Len(CStr(psno))); psno; Spc(3);
Print #1, particulars; Spc(17 - Len(CStr(particulars)));
Print #1, Spc(6 - Len(CStr(grams))); grams;
Print #1, Spc(8 - Len(CStr(wastage))); wastage;
Print #1, Spc(7 - Len(CStr(trate))); trate;
Print #1, Spc(7 - Len(CStr(mc))); mc;
Print #1, Spc(7 - Len(CStr(sc))); sc;
Print #1, Spc(11 - Len(CStr(amount))); amount
tcount = tcount + 1
psno = psno + 1
Wend
For i = 1 To 9 - tcount
Print #1, vbCr
Next i
Print #1, Spc(5); "Discount : "; disctxt.Text; Spc(5); "VAT : "; vattxt.Text
Print #1, vbCr
Print #1, Spc(76 - Len(CStr(Netamttxt.Text))); Netamttxt.Text
Print #1, Chr(12)
Close #1
'Shell App.Path & "\PRINT.BAT", vbHide
Shell "E:\jewelproject\PRINT.BAT", vbHide
'Shell "c:\1.txt", vbHide
End Function
Public Function Header()
cname = cnametxt.Text
bdate = datetxt.Text
place = cptxt.Text
bno = Bnotxt.Text
For i = 1 To 6: Print #1,: Next
Print #1, Spc(18); cname; Spc(42 - Len(Name)); bdate
Print #1, Spc(18); place; Spc(42 - Len(bno)); bno
Print #1, vbCrLf
Print #1, Spc(5); "Sl.No"; Spc(3); "Particulars"; Spc(6); " Grams";
Print #1, " Wastage"; Spc(3); "Rate"; Spc(3); "MC"; Spc(5); "SC"; Spc(6); "Amount"
Print #1, vbCrLf
My Problem : while printing the paper moves for A4/Letter and i cann't able to enable the Tear off Mode.
1. How can i modify above code to fix paper size Height : 6 inches Width of paper : 9.1 inches
|
|
|
|
|
I'm new in vb.net .. i don't know how to display current date (ddmmyy) .. i try to find the command... but cannot find it.. plssss... anybody can help me?
|
|
|
|
|