|
How can I access the name of the server that my code is running on in VB?
|
|
|
|
|
in VB6 you can use the winsock control and query it's hostname related property.
or you can use the 'GetHostByName' WinAPI function
"It was when I found out I could make mistakes that I knew I was on to something."
-Ornette Coleman
|
|
|
|
|
I've got a spin box, how do I set it so that it controls the current value of one of the attributes of my ScrollableControl??
-------------------------------
To begin at the beginning
|
|
|
|
|
Presumably the spin box control raises an event such as SpinBox1.PositionChanged or something similar (Check the controls documentation). You need an event handler for this in pseudocode it is something like this:
<br />
Private Sub SpinBox1_PositionChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SpinBox1.PositionChanged<br />
'Code to handle event here.<br />
End Sub<br />
The event handler should pass data back in the Event args that you can use to set the attribute of the ScrollableControl or you could use the SpinBox controls property to set the value:
<br />
Private Sub SpinBox1_PositionChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SpinBox1.PositionChanged<br />
ScrollableControl.MyAttribute = e.Position<br />
'Or<br />
ScrollableControl.MyAttribute = SpinBox1.Position<br />
End Sub<br />
If you are using VS.Net intellisense should point you in the right direction.
What are the controls that you are using and what are the properties, events and methods that you wish to change on them?
Jim
|
|
|
|
|
Hi Friends
I want to do this without database support. all i m using is collections(ArrayList). my
data is stored in the ArrayList.
I have few entries in my collection and i want to display the entire collection in the
CheckedListBox so the user can make selection, i also want to diaplay TextBoxes for each
record in the collection to be displayed in the CheckedListBox. so in each row displayed
it will display 1 CheckedListBox and 2 TextBoxes + some text retrived from the
collection.
Some thing like below :
...
1. "CheckedListBox" sometext "TextBox" sometext "TextBox"
2. "CheckedListBox" sometext "TextBox" sometext "TextBox"
3. "CheckedListBox" sometext "TextBox" sometext "TextBox"
4. "CheckedListBox" sometext "TextBox" sometext "TextBox"
5. "CheckedListBox" sometext "TextBox" sometext "TextBox"
...
If any one can get the solution to this without database support, it will be of great help
to me
I am not sure whether this can be done without database support or not...!
Many Thankx
Jay
|
|
|
|
|
I have a VB 6 app where we control which menu items to enable based on security policies assigned to users.
To automate the code we stored the menu control names in a table and then assigned these to various security groups.
When a user logged on we read in the list of menus. We than looped through all the controls on the form and looked for controls with ames that match our list and eabled/dissabled appropiately.
in Dot net for some reason Microsoft have hidden the "name" propert for menuitem & panelbutton controls. this means that I CANNOT just loop through a collection and check their names.
I have tried using the REFELCTION code but still cannot see the names of these controls.
Does nayone know of a way to either get these controls names or doing what i did so easilly in VB6.
Please DO NOT tell me to hard code the checking in the form. This would mean that every time I adda new menu item I am going to have to add code in the form to enable/dissable it. Rembeber I might end up having over a hundred forms.!
Thanks in Advance
Del
|
|
|
|
|
I had a similar problem with the MenuItem control, and I got around it by assigning string information to the Tag property. When looping through a collection of controls, I checked the type to see if it was a MenuItem, and if it was, I compared against the Tag instead of the Name like I was using for the rest of the controls.
This still means you'd need to add the Tag info to all those forms, but your application code would still just be in the one place.
To not know is bad.
To not wish to know is worse.
|
|
|
|
|
Hi Guys.
Any ideas on how to find out the ColorSpace of an image file. It doesn't seem to be available through the normal properties/attributes.
Image might be a tif, jpg, bmp, etc.
The app needs to move cmyk pics to one directory while rgb pics go to another.
Any help for a newbie would be appreciated.
|
|
|
|
|
I would like to write some software which checks the status of a printer, gets number of page counts, error details, paper capacity levels etc. through the network.
The printer I using is a DocuPrint N4525.
Some options could be MIBs, LPR/LPD, Port 9100, port 80, IPP, SNMP.
What would the best way be and where could i find documentation for that.
|
|
|
|
|
Your going to have to get with Xerox on that. They have their own program that retrieves that kind of information from the printer. And since you have to register that program, I'd guess that they are not going to give up the protocol information without a fight.
I can't find any publicly available documentation on how these stats are retrieved. I can tell you it is done using TCP Port 9100 on the printer, but the only documentation on that port is that it supports RAW printing, although the documentation on XManager states that it also uses that port for two way communication that does exactly what you want.
RageInTheMachine9532
|
|
|
|
|
There is a .NET component what I at this site[^] that does that.....
|
|
|
|
|
That component monitors the queue and the jobs in it. It does not monitor the status of the printer itself. What he is looking for is hte status of the printer, the error logs, paper capacity remaining, ... stuff like that.
|
|
|
|
|
The PrinterMonitorComponent.PrinterInformationChanged will fire when the status of the printer changes and the PrinterInformation class passed in the event args has status, pages printed etc....
'--8<------------------------
Ex Datis:
Duncan Jones
Merrion Computing Ltd
|
|
|
|
|
I'm sorry, but I don't see in your components, where it returns the printer's Error History and current Paper Capacity remaining.
RageInTheMachine9532
|
|
|
|
|
A colleague of mine is using the Shell command to run winzip and compress the files, with the 'Wait' parameter set to True, but sometimes when subsequent code tries to move the zip file, an exception occurs because the file is reported to be in use.
I suspect that winzip is somehow slow at releasing the file, and Shell returns before this happens. Any ideas?
The difference between a pessimist and an optimist is that while the pessimist is always a victim, the optimist is always a target. - Brady Kelly
|
|
|
|
|
Is there a function that can tell whether the computer desktop is locked requiring CTRL-ALT-DELETE and a logon?
Dave
|
|
|
|
|
Anybode plz help me.
In my application i want to implement context sensitive help. i got it through F1 help provider. but i'm getting the context sensitive help only when i press F1 key. but i want the same functionality, through a button click.
How to c the code that was written for F1_click?
|
|
|
|
|
hi,
i'am new .net programmer,want to know how to connect database data with textbox on the form,i want to know the procedure while connecting to the database,-sqlserver,sometimes access also,
please can u help me,thanks in advance
guys this i got it,now the problem is how do it manually as we used to do using adodb in vb 6,plese anyone can help me out.desperately waiting for a reply from u guys
shubha rahul,mumbai
|
|
|
|
|
Hello All..
I wonder how microsoft insert the date (today date) to the document.
what happen after insertion? did it just insert it or have an record of saying this particular date is inserted by Insert->Date ( autodate)
Is there any different between Insert->Date and the date we just type in like (12-10-03) ??
|
|
|
|
|
I would like to be able to pick a colour on a PictureBox control and make it transparent. How can I then save the image as a gif file with transparency. I have a program that draws shapes on an image in a picturebox, however when I save the image none of the shapes that I have drawn are saved. What do I need to do to achieve this. Any help is appreciated.
Jim
|
|
|
|
|
OK, first of all, are you drawing the shapes on the PictureBox's Graphics, or a Graphics created from the bitmap? You need to create a graphics from the bitmap using Graphics.FromImage(), and then draw on that.
About transparency, I really don't know how to do that with GIFs in GDI+. I believe the first entry in the palette is the transparent color, but I don't know how to set that with GDI+.
"Have a heart that never hardens, a temper that never tires, a touch that never hurts." -- Charles Dickens
FLUID UI Toolkit
|
|
|
|
|
Thanks for your reply
In my program the PictureBox is either loaded from a file:
pictureBox.Image = Image.FromFile(dlg.FileName)
Or from a stream:
Dim binaryData(-1) As [Byte]
binaryData = Base64Utility.GetByteArray(_ImageData)
Dim ms As New MemoryStream(binaryData)
_PictureBox.Image = Image.FromStream(ms)
To draw on the PictureBox I am calling the Invalidate method which then fires the Paint event:
pictureBox.Invalidate()
In the paint event I am passing the PaintEventArgs to this Draw Sub.
Public Sub Draw(ByVal p As Pen, ByVal e As PaintEventArgs) Implements IHotspot.Draw
If _bEndIsSet Then
e.Graphics.DrawRectangle(p, New Rectangle(_ptOrigin.X, _ptOrigin.Y, (_ptEnd.X - _ptOrigin.X), (_ptEnd.Y - _ptOrigin.Y)))
e.Graphics.DrawRectangle(p, _ptEnd.X - 2, _ptEnd.Y - 2, 4, 4)
'e.Graphics.DrawString(CStr(_ptOrigin.X) & ":" & CStr(_ptOrigin.Y), New Font("arial", 8, FontStyle.Regular), Brushes.Yellow, _ptOrigin.X, _ptOrigin.Y)
End If
End Sub
So instead of using e.Graphics I should be using Graphics.FromImage() to draw on?
Jim
|
|
|
|
|
Jim Taylor wrote:
So instead of using e.Graphics I should be using Graphics.FromImage() to draw on?
Correct. In VB6, you could draw on the picturebox and what you drew would show up on the image, but with VB.NET, this doesn't happen. IMO it's much better that way.
"Love does not delight in evil but rejoices with the truth." -- 1 Corinthians 13:6
FLUID UI Toolkit
|
|
|
|
|
|
Any ways to do MDI in VB.NET?
Sonork 100.41263:Anthony_Yio
|
|
|
|