|
Actually, you can disable tab pages. Read this[^] thread.
50-50-90 rule: Anytime I have a 50-50 chance of getting something right, there's a 90% probability I'll get it wrong...!!
|
|
|
|
|
Didn't know that!
Although, i dare say if you are using unsupported methods (or hidden ones) and something breaks folling updates to the api, you don't really have a leg to stand on!
|
|
|
|
|
You need a reference for Form1 in Form2 so you can directly manipulate its controls and set its properties.
|
|
|
|
|
Hi Shameel,
I am sedning You the actual scenario where I am using multiple forms this:
I have 2 forms, main Form1 and a loginform. I made a click event for OK button in loginform, so once user clicks the OK button, I want to call one function which is defined in Form1 as a Public. The code structure is like this:
in main Form1, i created a function like this:
Class Form1()
Public Function DoThis()
....some task...
End Function
End
now in loginform, in the click event for OK button:
Class loginform()
Click_OK()
{
DoThis()....call function DoThis() of Form1
}
End
I am not able to call the DoThis() function in loginform. Please tell me how to do this??
Hope my problem is clear..Thanks.
|
|
|
|
|
To call a function on Form1, you need a reference to the form in your loginform. It depends on where you instantiate Form1 in your app. Assuming that you instantiate Form1 in loginform (since loginform should ideally be the first form that is loaded in your app from main() method), the code could be something like this:
Form1 form1 = new Form1();
form1.DoThis();
form1.Show();
|
|
|
|
|
my Form1 is the first form which get loaded. loginform is loaded on the click of a button on Form1.
Pls tell me how to do this.
|
|
|
|
|
loginform.cs
Form1 _form1;
public loginform(Form1 form1) {
_form1 = form1;
}
public DoSomething() {
_form1.DoThat()
}
Form1.cs
private button1_Click(...) {
loginform fLogin = new loginform(this);
loginform.ShowDialog();
}
|
|
|
|
|
Hey all,
I at a bit of a loss on what to look for here and kind of even how to word it. I am developing an application in .net cf that runs on multiple platforms, basically the 2 mentioned above. The program was originally written for the iPaq2215 running i guess cf 4.2 and then we started running the program on smart phones (plam treo 850s) running win 6.1. The application captures a signature, saves the file to a bitmap, prints the invoice details, load the bitmap, and prints it. When I print from the iPaq, the full image prints, when I print from 6.1 pro device, I loose about the right hand side quarter. I dont know enough about graphics and stuff, so I dont know if there is an issue with the SHLoadGraphics function rendering to the pixel resultion of the device or what. If it does render to the device resolution, does anyone have any ideas on how to downgrade the resolution of the newer devices to be able to print the full image. I have tried changing screen size, control size, changing the screen's autoscalemode, but to no avail. Also, I checked the properties of the images and both images contain the same properties (width: 239 pixels, height: 128 pixels, horzres: 96dpi, vertres: 96dpi). When I copy the image from the iPaq to the phone and print, I get the problem, when I copy the image from the phone to the iPaq and print, I dont have any issues. The printer in question is a Citizen CMP10BT, however I dont see the printer being the issue since I can print both images from the iPaq properly. I have also tried to save the image on the phone and load it into a smaller bitmap using the graphics utilities provided by 6.1 by creating a new bitmap with smaller dimensions, but this also ended up doing the same thing. Any ideas or guidance as to where to turn to on this issue would be greatly appreciated. As I prefixed this question with ealier, I am sorry if I am in the wrong spot or bad phrasing.
Thank you in advance for any help provided.
Kevin
|
|
|
|
|
I have finished my winform project. And now, i want to setting my application full screen mode. I tried, but my layout was not is the same as mode is before full screen. Help me to break problem. Thanks
|
|
|
|
|
By setting the Dock and Anchor properties properly for all your controls.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
I don't think so, when u dock property not none, your control will bigger and get along the border's form. Thanks for your attention
|
|
|
|
|
Christian did say "when you PROPERLY" set the Docking on the controls. Also, you may have to redo the layout of your form and use other contain controls such as TableLayoutPanel and Panel controls.
I think it was funny when you said that you "finished" your app, now you want to change it. If that's the case, then it's not finished. Now you know what is meant by the term "feature creep".
|
|
|
|
|
cotdot11111 wrote: I don't think so,
Well, if you know the answer, why are you asking us ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Christian Graus wrote: Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
I'm sorry if i annoy you , I mean we have been discussing a problem and i just show my opinion. I tried your solution, but i can't get the result. So, could you give me a specific way( maybe a simple project with 1-2 button ) thank you very much. My email : khanhtruong.uit@gmail.com
I'm looking forward your help
Thanks again
|
|
|
|
|
I am not mailing you anything, if I did, you'd have my mail. The ANCHOR property is the one you're going to set for most controls. You can set as many sizes as you want, and those will scale. Just put two buttons on a form, and play with thier anchor properties, you'll get the idea.
I told you you needed to use the anchor property in my first post, so did the other person who replied.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Hi Everyone,
I want to do the following:
Press TAB To Jump From one Textbox To Another Textbox in a Form.
How to implement this? Can someone help me on this?
Regards
R.S.
|
|
|
|
|
this is already natural behavior as long as you have the tabindex of the 2nd textbox set to 1st textbox.tabindex+1?
'Never argue with an idiot; they'll drag you down to their level and beat you with experience.' ~ anonymous
'Life's real failure is when you do not realize how close you were to success when you gave up.' ~ anonymous
|
|
|
|
|
Can You please elaborate a little bit more, as I have already created 8 textboxes and want to implement what You said?
|
|
|
|
|
When in form design, click the VIEW menu and select the menu item, TAB ORDER, you can then click the controls on the form to establish what the order will be when you press the tab key.
If you do not what a control to take part in TAB ORDER, set its tabcontrol property to false.
Alternate method for setting tab order, is to manually set each controls tab index property to a number. The first method is the best option.
|
|
|
|
|
Hi All,
Writting an ASP.NET app, I'm connecting to an sql database, connection is 100%, I just need the code to store a column value on a defined variable, I dnt want to diplay it jst the code to read the column value.
Dim connCatapult As New OleDb.OleDbConnection("Provider=SQLOLEDB;Data Source=CATAPULT;Initial Catalog=Catapult;Integrated Security=SSPI")
Dim daCatapult As New OleDb.OleDbDataAdapter("Select TestUserLoginDetails.UserName, TestUserLoginDetails.Password FROM TestUserLoginDetails", connCatapult)
Dim dsLoginData As New DataSet()
Dim strUsername As String = Login1.UserName
Dim strPassword As String = Login1.Password
daCatapult.Fill(dsLoginData, "TestUserLoginDetails")
'connCatapult.Open()
'**********This is all that i'm trying to do*****************
Dim strDbUserName As String
strDbUserName = ????????????????????
'********************************************************
please assist
|
|
|
|
|
Assuming that that query will only return one row, the following should work (but no guarantees):
strDbUserName = dsLoginData.Tables(0).Rows(0).Item("UserName")
EDIT: You may want to build in a check, because in case the query does not return any result you'll get an exception in your code.
My advice is free, and you may get what you paid for.
|
|
|
|
|
Use OleDbCommand.ExecuteScalar() if you return a single value from the query.
|
|
|
|
|
Hi!
I have stumble on the keyword WithEvents, here is a code example:
Public Shared WithEvents theOpcServer As OPCAutomation.OPCServer = Nothing
Public Shared WtihEvents theOpcGroup As OPCAutomation.OPCGroup
What's the difference with those two declarations compared to:
Public Shared theOpcServer As OPCAutomation.OPCServer = Nothing
Public Shared theOpcGroup As OPCAutomation.OPCGroup
OPCAutomation is a reference from a DLL-file which I'm using in my application and OPCServer and OPCGroup are two classes from that namespace.
For my application is doesn't matter if I have 'WithEvents' or not. Can someone explain the 'WithEvents' keyword?
|
|
|
|
|
Selecting the word and than pressing F1 gives you the help.
Withevents let you select the events possible for that control at designtime
|
|
|
|
|
WithEvents has one powerful extra feature.
To use your example. Suppose you start with a variable such as
Public Shared theOpcServer As OPCAutomation.OPCServer = Nothing
We also assume you have and event handler somewhere eg.
Public Shared Sub OpcServerEventHandler(sender as Object, e as EventArgs)
With this code every time you assign an object to theOpcServer you need to attach and remove the Event Handlers. eg.
If theOpcServer IsNot Nothing Then
RemoveHandler theOpcServer.OpcServerEvent, AddressOf OpcServerEventHandler
End If
theOpcServer = New OPCAutomation.OPCServer()
AddHandler theOpcServer.OpcServerEvent, AddressOf OpcServerEventHandler
Alternatively use the WithEvents keyword and a Handles clause on the event handler sub.
Like this .Net does all the event handler maintenance for you without having to write armfuls of code.
If you have knowledge, let others light their candles at it.
Margaret Fuller (1810 - 1850)
www.JacksonSoft.co.uk
|
|
|
|