|
I find the problem the other way round.
I design on my laptop (1920x1200) primarily and my home pc (2560x1600). As you can see these resolutions are are bigger than the average joe's. They look fine on these, but when i run them on things with smaller resolution, i always find they look terrible.
Nobody said it would be easy! I tend to start at an 800x600 or 1024x768 window size, depending on what i am doing, and see how they look.
|
|
|
|
|
I just tried the program on the 17 inch and it has done what i thought it would and it is basically to far "zoomed in" I just tried to dock the items however it messes up the order i have them in. What is the best way to dock items?
|
|
|
|
|
Getting a form to behave reasonably at different screen resolutions can be tricky, I use a combination of docked panels and anchored controls. Pick the control to dock as fill, usually a list control. You also need to be aware of the z order of the controls when docking (bring to front and send to back) as these will seriously screw with your layout.
Design for the smallest reasonable screens resolution, don't force full screen, let the user do that.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I was hoping if anyone can help me with parallel port interfacing using Visual Basic, I have done some research on the internet and found a few good sites. However since I don't know much about Visual Basic I was wondering if anyone can help me get started with it. Firstly I am going to try to communicate through the parallel port to light up a few LEDs, anyone know how to do this? And also does anyone know how to start a normal 3v DC Motor using Visual Basic programming? Your help will be much appreciated
|
|
|
|
|
Hi,
PC ports are dealing with information, not power. They can't supply enough power to directly drive a motor or a lamp, a LED would be fine though.
Parallel port isn't extremely easy, as it is a shared resource, and .NET does not provide a class for it.
It is much easier to use a serial port; see the SerialPort class (since .NET 2.0). The typical serial port has 2 data lines, and some 6 control lines (some inputs, some outputs). The latter are the easiest to use, just hook up an LED (with appropriate series resistor, say 1000 ohm), and start setting the control outputs either high or low, using properties such as DtrEnable and RtsEnable.
BTW: there are some articles here on CP about the subject.
|
|
|
|
|
Hi,
so can the pc port not send a signal to the motor in the same way it does to the LEDs. In addition I have looked on the internet and found some articles which use DLL files such as inpout.dll so I don't think you need a class for it. As this is part of my project we have already built the hardware based on the parallel port so hopefully I can find some info on that. Is there anything you advise or suggest on interfacing parallel port? Also is there another way you would recommend to start up the motor using programming?
|
|
|
|
|
Every PC port can send a signal, none of them can provide hundreds of milliamps to drive anything. A LED is the maximum load you should apply; for heavier loads, you need electronics and/or relays. If you try nonetheless, you will probably fry your port. Beware of starting currents, they are even higher as the steady-state current. Furthermore, most motors will require a higher voltage, maybe 12 Volt or more. That too is beyond the capabilities of most ports.
Check the article referred to by Lloyd (which deals with LEDs!), and look for some others for higher voltages and currents.
|
|
|
|
|
Hi
Will I/O Ports with C# help? I know it's written in C#, but the code won't be too hard to convert to VB, as it will probably be mainly Windows API calls
|
|
|
|
|
well C# can help considering it communicates with parallel ports and you are right there is not much difference, in addition to the point Luc, this motor is only 3v. Basically my project is to create a automatic nut counter where we build a design and we have motor to control the flow of the nuts, so in addition we also have sensors to count how many nuts is passed through, my job is to create a program to count the nuts and displaying them on a website. So the first step in doing this is creating a user interface so the user can actually interact with the program ie start the program via a button. I have already tried using java but it is very hard, I have also tried visual c but there is no facility to create a GUI like there is in visual basic. Any suggestions? thank you for your help so far
|
|
|
|
|
Visual Studio allows you to create GUI apps in any .NET language with the same ease as Visual Basic has offered for decades. Create a new "Windows Application" and drag Controls from the ToolBox to your Form. etc.
What are the steady-state and rush-in currents your 3V motor requires? More than say 20 mA needs electronics or relays.
|
|
|
|
|
I understand what you are saying about Visual Basic regarding the GUI apps they have, I am aware of that. However visual c uses .cpp files and when i open them in visual studio I Cannot create any GUI as I don't think it is compatible with it. So as a result I have decided that I am going to use Visual Basic for my project. With regards to your question about the motor, I honestly don't know what currents are needed as I am part of the software team, I only know that it is a general purpose motor which is 3V DC. Can you send me the link with the LED example as this might help me in implementing my project
|
|
|
|
|
Here is a good article about the subject at the community.
http://www.codeproject.com/KB/cs/cspplcds.aspx
Sigurd Johansen
|
|
|
|
|
Hi,
compare data in two database objects into list1 want to, Can you help me fix my errors in the code?
Dim CON1 As New ADODB.Connection
Dim CON2 As New ADODB.Connection
Dim kayit1tablo As New ADODB.Recordset
Dim kayit2tablo As New ADODB.Recordset
Dim rs1 As New ADODB.Recordset
Dim rs2 As New ADODB.Recordset
Private Sub cmdKayitGoster_Click()
On Error Resume Next
Dim i, k, bulunan
aranan1 = CON1.Open & App.Path & "\a.mdb"
aranan2 = CON2.Open & App.Path & "\b.mdb"
rs1.Open "Select * from Master where veri1=" & Val(aranan1), CON1, adOpenKeyset, adLockOptimistic
rs2.Open "Select * from master where veri2=" & Val(aranan2), CON2, adOpenKeyset, adLockOptimistic
For k = 0 To rs1.RecordCount - 1
bulunan = "0"
For i = 0 To rs2.RecordCount - 1
bulunan = "1"
End If
Next
If rs1.RecordCount(k) = rs2.RecordCount(i) Then
Else
List2.AddItem rs(veri1)
End If
Next
End Sub
Private Sub Form_Load()
Set CON1 = New ADODB.Connection
Set CON2 = New ADODB.Connection
CON1.Open "Provider=Microsoft.jet.oledb.4.0; Data Source=" & App.Path & "\a.mdb"
CON2.Open "Provider=Microsoft.jet.oledb.4.0; Data Source=" &
App.Path & "\b.mdb"
kayit1tablo.Open "Select * from Master", CON1, adOpenKeyset, adLockOptimistic
kayit2tablo.Open "Select * from Master", CON2, adOpenKeyset, adLockOptimistic
End Sub
|
|
|
|
|
You can have another selection
rs3.Open "Select * from master where veri1<>veri2, CON2, adOpenKeyset, adLockOptimistic
For u = 0 To rs3.RecordCount - 1
List2.AddItem rs3(veri1)
Next
Something, like the above...
|
|
|
|
|
Hi and thanks for looking at my question(s). I took VB (using VS 2008) last year and haven't looked at it since and would like to try and apply a little bit of what I learned.
I want to read a zip file, unzip and copy the folders into a particular directory structure.
If the parent folder already exists, I want to only copy in the sub folders. If the sub folders exist I want to exit the application.
Thank you again for looking.
Danny
|
|
|
|
|
|
|
Is there a way that a component array can be created in vb.net like in vb6? For example if I need to create a button Array? Any examples? I am looking to shorten the code below.
Menuitem1.Text = item(0).menuitem
MenuItem2.Text = item(1).menuitem
MenuItem3.Text = item(2).menuitem
MenuItem4.Text = item(3).menuitem
MenuItem5.Text = item(4).menuitem
MenuItem6.Text = item(5).menuitem
MenuItem7.Text = item(6).menuitem
MenuItem8.Text = item(7).menuitem
MenuItem9.Text = item(8).menuitem
MenuItem10.Text = item(9).menuitem
MenuItem11.Text = item(10).menuitem
|
|
|
|
|
You can either create a List(Of TextBox) and put your controls in the list, or you can put your MenuItem TextBoxes in a separate panel and iterate through the controls on the panel.
|
|
|
|
|
You can Create a Array of Component. Bydefault it is not possible.but You can use a function to create no. of Components to create. The main thing is that you should dispose every component. Else it will be generate error.
If you can think then I Can.
|
|
|
|
|
I'm trying to do a mapping exercise and if a user clicks on a column and it has already been mapped, I want to check the corresponding radio button. If I use a For Each loop to loop through the controls of a group box, I can find the control/radio button, I can change the Text, Font size, position and many other things, but I cannot change the Checked status. What am I missing?
Thanks in advance,
Steve
|
|
|
|
|
AFAIK you can get and set RadioButton.Checked; setting it might fail if it is disabled.
And then there is RadioButton.PerformClick()
|
|
|
|
|
AFAIK?
Was able to get to the Checked property by converting the Control to a Radio Button using CType.
Private Sub ChecktheRadioButton(ByVal sName as String)
Dim ctr as Control
For Each ctr in GroupBox2.Controls
If ctr.Name = sName then
CType(ctr,RadioButton).Checked = True
Exit Sub
Next
End Sub
|
|
|
|
|
See, there is no problem whatsoever. Of course it has to be a Control that HAS a Checked property.
Now try this:
CType(GroupBox2.Controls(theNameOfMyTargetRadioButton),RadioButton).PerformClick()
|
|
|
|
|
Beautiful. That did the trick.
But still a bit confused - what is AFAIK
|
|
|
|